base64decode

Base64 to PDF

Paste a Base64 string to turn it back into a PDF file, preview it and download it. Works with or without the data:application/pdf prefix, all in your browser.

0 characters
Decoded outputWaiting for input

      
    

Decoding runs entirely in your browser. Nothing you paste is uploaded.

How to convert Base64 to PDF

  1. Paste the Base64 string into the box above. It may come with a data:application/pdf;base64, prefix or without one.
  2. The decoder checks the first bytes. A real PDF starts with %PDF, which is JVBERi in Base64. When it finds that signature, the label shows PDF document and the Preview tab opens the file in a viewer.
  3. Click Download file to save it as decoded.pdf.

The PDF is rebuilt in your browser and never uploaded. That matters for invoices, contracts, statements and other documents you would rather not send to a stranger's server.

Where Base64 PDFs come from

If you have a JSON response, copy only the value of the field, without the surrounding quotes.

Check that a Base64 string is a PDF

Look at the start of the string. PDF data in Base64 almost always begins with JVBERi0, which decodes to %PDF-. If your string starts with something else, it is probably not a PDF:

Base64 starts with It is probably
JVBERi0 PDF document
UEsDB ZIP archive (also DOCX, XLSX)
iVBORw0KGgo PNG image, see Base64 to Image
H4sI GZIP-compressed data

The decoder does this check for you and shows the result in the label above the output.

Why a Base64 PDF will not open

The string is truncated. PDFs are large, and a Base64 PDF can run to hundreds of thousands of characters. Log viewers and some terminals cut long lines. A truncated PDF either fails to open or opens with missing pages. Copy the value from the original source.

JSON escaping. Some systems escape / as \/ inside JSON. Those backslashes are not Base64. Remove them, or parse the JSON first and copy the clean value.

It is compressed or encrypted first. If the label says GZIP data or Binary data, the PDF was wrapped before encoding. Save the file and unpack it with the right tool.

The viewer is blocked. Some browsers do not show PDFs inside a page. Download the file and open it in your PDF reader instead.

Base64 PDF size

Base64 adds about a third to the size, so a 300 KB PDF arrives as roughly 400 KB of text. The info line under the result shows the decoded size in bytes, which is the size of the file you will download.

For images, use Base64 to Image. For any other string, go back to the Base64 decoder.

Last updated:

Base64 to PDF FAQ

Is my PDF uploaded?

No. The PDF is decoded in your browser and never sent anywhere.

Can I paste a data URI?

Yes. Paste the full data:application/pdf;base64, URI or just the Base64 part. Both work.

Why does the downloaded PDF say it is damaged?

Almost always the string is incomplete, or it contains JSON escapes such as \/. Copy the full value from the source and remove any characters that are not Base64.

How do I know the string is really a PDF?

Base64 PDF data starts with JVBERi0, which decodes to %PDF-. The tool also checks this and labels the result PDF document.

Is there a size limit?

There is no fixed limit. It depends on your browser's memory, and PDFs of several megabytes decode normally on a laptop.