Base64 to PDF

Decode a Base64 string into a PDF, preview it and download the file.

Base64 to PDF decodes a Base64 string into a PDF file that you can preview and download. It accepts raw Base64 or a data:application/pdf;base64 URI, checks that the decoded bytes really are a PDF, and shows the file size. It is useful when an API returns a document as Base64 text.

What is a Base64-encoded PDF?

A PDF is a binary file, so many JSON APIs, email systems and databases carry it as Base64 text instead. The Base64 form is about 33 percent larger than the file and starts with recognisable characters: every PDF begins with the bytes %PDF-, which in Base64 appear as JVBERi0. Decoding turns the text back into the original bytes, which is the file. A data URI is the same thing with a prefix such as data:application/pdf;base64, in front. This tool decodes the text, checks for the %PDF- signature in the first 1024 bytes, and then lets your browser display or save the result. Passing the signature check shows the data looks like a PDF, but it does not prove the file is complete or free of problems.

How to use Base64 to PDF

  1. Paste the Base64 Paste the Base64 string or data URI into the Base64 PDF box.
  2. Check the result If the data is a PDF, a message appears saying Valid PDF detected with the size in KB. Otherwise an error explains what went wrong.
  3. Preview Scroll down to the embedded viewer to read the document.
  4. Download Click Download PDF to save the file as document.pdf.

Frequently asked questions

Why does my Base64 start with JVBERi0?

The first bytes of every PDF are %PDF-, and those bytes encode to JVBERi0 in Base64.

Can it handle data URIs?

Yes. A data:application/pdf;base64, prefix is removed before decoding.

Why is the preview empty?

Your browser may not support inline PDFs, or the PDF may be damaged. Use Download PDF and open it in a viewer.

Does a valid message mean the PDF is intact?

Not necessarily. The tool only checks for the %PDF- signature, so a truncated or damaged file can still pass.

Is the file uploaded?

No. The data is decoded in the page and displayed from a local object URL. It is not sent to a server.