Base64 to PDF turns a Base64 string — from an API response, database field or email source — back into a PDF file you can open and download. It also checks the result really is a PDF, converts Base64 PNG and JPEG images into a PDF, and works the other way round, encoding PDFs and other files to Base64. Everything runs in your browser.
| Type | Base64 begins with |
|---|---|
| JVBERi0 | |
| PNG | iVBORw0KGgo |
| JPEG | /9j/ |
| GIF | R0lGOD |
Paste the Base64 string (with or without the data: prefix) and click Download PDF.
It may be cut off or contain extra characters. The tool tells you if invalid characters are present or if the PDF looks truncated.
Yes. Drop the file in the second section and copy the Base64 or data: URI.
Yes. - and _ are handled automatically, and missing padding is added.
No. Decoding and encoding happen in your browser.
Pasted text is cleaned before decoding: a data: URI prefix is removed, whitespace and line breaks are stripped, URL-safe Base64 (- and _) is converted to standard Base64, and missing = padding is added, so strings copied from JSON, emails or logs decode without editing. Anything outside the Base64 alphabet is reported rather than silently dropped. The decoded bytes are identified from their first bytes — %PDF- for PDFs, the PNG and JPEG signatures for images — instead of trusting the string's label, and a PDF's version and whether it ends with %%EOF (a sign it wasn't truncated) are shown. PNG and JPEG images can be wrapped into a one-page PDF. In the other direction, any dropped file is encoded to Base64 in 32 KB chunks so large PDFs don't overflow the browser, optionally as a data: URI.