Base64 to PDF




Base64-encoded PDFs show up constantly in developer work — API responses that return file data as a string, email MIME attachments, data URIs embedded in HTML, and database blobs stored as text. When you need to extract and view that PDF without writing code to decode it, this tool handles the decoding instantly.

Paste your Base64 string and download the decoded PDF file.

How to Convert Base64 to PDF

  1. Copy the Base64 string from your API response, database query, or source code. A valid PDF Base64 string starts with JVBERi0x (the Base64 encoding of the PDF magic bytes %PDF).
  2. Paste the full Base64 string into the input area. Do not include the data:application/pdf;base64, prefix — paste only the encoded data itself.
  3. Click Convert. The tool decodes the string and generates a downloadable PDF.
  4. Download the PDF. If the output is corrupted, the Base64 string may be truncated or contain line breaks.

Common Base64 PDF Sources

Source Example format What to paste
API JSON response “pdf”: “JVBERi0x…” The value string only, no quotes
HTML data URI data:application/pdf;base64,JVBERi0x… Everything after the comma
Email MIME part Content-Transfer-Encoding: base64 then data The data block, no headers
Database blob (text) Raw Base64 string Paste as-is

Things to Know

  • A valid Base64-encoded PDF almost always starts with JVBERi0x — these are the Base64 characters for %PDF, the PDF file signature. If your string starts differently, it may not be a PDF.
  • Base64 strings must not contain line breaks within the encoded data. Some systems insert line breaks every 76 characters. Remove all line breaks before pasting if conversion fails.
  • The data:application/pdf;base64, prefix is not part of the Base64 data — remove everything up to and including the comma before pasting.
  • Base64 encoding increases file size by approximately 33%. A 1MB PDF becomes roughly 1.33MB when encoded as Base64.

Common Questions

How do I convert Base64 to a PDF file?

Paste your Base64 string into the input area and click Convert. Make sure to remove the data:application/pdf;base64, prefix if present — paste only the Base64 data itself.

How do I know if my Base64 string is a PDF?

A Base64-encoded PDF almost always starts with JVBERi0x — these decode to %PDF, the standard PDF file signature.

Why does my decoded PDF come out blank or corrupted?

The most common causes: the string is truncated, it contains line breaks, or the data:application/pdf;base64, prefix was included. Remove line breaks and the URI prefix, then try again.

Can I convert Base64 to PDF without writing code?

Yes — paste the Base64 string and click Convert. No programming knowledge or command-line tools needed.

About this tool: Base64 to PDF runs entirely in your browser. No software to install, no account required. Files are deleted automatically. See our Privacy Policy.

Last reviewed:  ·  Contact us

{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”How do I convert Base64 to a PDF file?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Paste your Base64 string and click Convert. Remove the data:application/pdf;base64, prefix — paste only the encoded data.”}},{“@type”:”Question”,”name”:”Why does my decoded PDF come out corrupted?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Usually truncated string, line breaks in the data, or the URI prefix was included. Remove all of those and retry.”}}]}