Paste a Base64-encoded PDF, with or without the data:application/pdf;base64, prefix, to check it, preview every page and download it as a .pdf file. Switch tabs to turn a PDF into a Base64 string. Everything is decoded locally in your browser.
Last updated:
0 characters
The PDF preview appears here.
Advertisement
Advertisement
How to use the Base64 to PDF
Paste the Base64 string into the box (it may start with JVBER or data:application/pdf;base64,). A sample is loaded so you can see how it works.
Read the check under the box: it confirms a valid PDF and shows its version, size and page count, or explains what is wrong.
Look at the preview to make sure it is the document you expect.
Set a file name and press Download PDF to save it, or Open in new tab to use your browser's PDF viewer.
Need the reverse? Open the PDF → Base64 tab, drop a PDF and copy or download its Base64 string.
Recognising file types from their Base64 start
The first characters of a Base64 string reveal the file type, because they encode the file's "magic bytes". Use this table to check what you have before converting.
JSON APIs cannot carry raw binary, so services that generate invoices, shipping labels, signed contracts or reports often return the PDF as a Base64 string inside a JSON field. Email attachments are also Base64 inside the MIME message, wrapped at 76 characters per line. When you need to test such an API, paste the whole JSON response here: the tool finds the field that holds the PDF.
Frequently asked questions
How do I convert Base64 to PDF?
Paste the Base64 text into the box. The tool removes any data URI prefix, quotes or line breaks, decodes the bytes, checks for the %PDF header and shows a preview. Press Download PDF to save the decoded file. The conversion happens in your browser, so the document is never uploaded.
How can I tell if a Base64 string is a PDF?
A PDF always begins with the bytes %PDF-, which encode to the Base64 characters JVBERi0. If your string starts with JVBER it is almost certainly a PDF. Images start differently: PNG with iVBORw0KGgo and JPEG with /9j/. This tool also names the real file type when the data is not a PDF.
Why does my Base64 PDF not open?
The most common causes are a string that was cut off when copied (the PDF has no %%EOF at the end), extra characters such as quotes or escaped \n sequences, a missing or wrong prefix, or data that was Base64-encoded twice. The checker reports each of these, and it removes quotes, escapes, whitespace and prefixes automatically.
What is data:application/pdf;base64?
It is a data URI prefix that tells a browser the following Base64 text is a PDF file. APIs and web apps often return PDFs in this form so they can be embedded directly. You can paste the string with or without the prefix.
How much bigger is Base64 than the PDF?
Base64 turns every 3 bytes into 4 characters, so the text is about 33% larger than the original file, plus line breaks if it is wrapped. A 750 KB PDF becomes roughly 1 MB of Base64.
Is it safe to decode confidential PDFs here?
Yes. The Base64 is decoded with JavaScript in your own browser tab and the preview is drawn locally. No text or file is sent to a server, and closing the tab removes the data.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.