Debugging API Base64 PDF Payloads Locally
Carrier APIs (FedEx, UPS, DHL), e-signature webhooks (DocuSign), and ERP billing endpoints frequently return PDF documents inside a JSON string field encoded as Base64. A healthy PDF payload always starts with JVBERi0 (%PDF-) and ends with an encoded %%EOF trailer; missing trailers usually indicate a truncated database column or proxy body-size limit.
Instead of uploading sensitive customer invoices or shipping labels to a remote converter, ByteHelpers decodes the Base64 string into a Uint8Array inside your browser, builds a local application/pdf Blob URL, displays the PDF version and exact decoded size, and gives you an instant preview and download button.
- PDF SignatureEvery valid PDF begins with %PDF- (hex 25 50 44 46 2D), which encodes to JVBERi0 in Base64.
- Privacy GuaranteeDecodes shipping labels, tax forms, and signed contracts strictly in RAM via Blob URLs—zero server transmission.
- Truncation CheckChecks for the trailing %%EOF marker to detect truncated API responses before you open the file.
Why do all Base64-encoded PDFs start with JVBERi0?
The ASCII header %PDF- (bytes 0x25 0x50 0x44 0x46 0x2D) always encodes to JVBERi0 in standard Base64. If your string starts differently, it may be gzip-compressed or wrapped in JSON quotes.
Why does my downloaded PDF show a blank or corrupt document error?
Common causes are truncated Base64 payloads missing the %%EOF trailer, unstripped JSON escape characters (\n or \/), or URL-safe Base64 characters (- and _) that were not normalized before decoding.
Is there a file size limit for Base64-to-PDF conversion?
There is no artificial server cap because conversion runs locally in your browser memory; multi-megabyte API PDFs decode in milliseconds.