Convert Base64 to PDF

Paste Base64 data or a PDF Data URI to validate, preview and download the decoded PDF — directly in your browser.

Input — Base64○ Waiting for input

Nothing to convert yet

Nothing to convert yet — paste your data or drop a file to begin.

Your files and data stay in your browser.

Inspection Report

Result metadata
Detected Type
MIME Type
Encoding
Input Length
Decoded Size
Padding Status
Data URI
File Signature
Preview Availability

How to convert Base64 to PDF

To convert Base64 to PDF, paste your Base64 string or PDF Data URI into the tool above. It validates the data, checks the %PDF- file signature, and shows a preview of the decoded document. You can then download it as a .pdf file — all processing happens locally in your browser, with nothing uploaded.

How to Use

  1. Paste your Base64 string into the input box. A full Data URI (data:application/pdf;base64,...) works too — the prefix is detected and removed automatically.
  2. The tool validates the Base64 and decodes it. If padding is missing or URL-safe characters are found, use the one-click fix.
  3. Check the inspector: it confirms the %PDF- file signature, MIME type and decoded size.
  4. Preview the PDF inline to make sure it is the document you expected.
  5. Click Download to save the .pdf file, or Copy to grab the cleaned Base64.

Real Example

The Base64 string JVBERi0xLjQK decodes to the bytes %PDF-1.4 followed by a newline — the opening of a real PDF document. When you paste a complete PDF's Base64, the inspector reports Detected Type: PDF, MIME: application/pdf, File Signature: %PDF-, plus the exact decoded size (for example 327 KB), and the preview renders the first page before you download anything.

Code Snippets

// Decode Base64 to a PDF and trigger a download (browser) const bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0)); const blob = new Blob([bytes], { type: 'application/pdf' }); const url = URL.createObjectURL(blob); const a = Object.assign(document.createElement('a'), { href: url, download: 'document.pdf' }); a.click(); URL.revokeObjectURL(url);

How Base64 to PDF Works

PDF files always begin with the five bytes %PDF-, which makes them easy to identify after decoding. This tool decodes your Base64 into raw bytes, reads the file signature from those bytes — not from any Data URI label, which can lie — and only then offers the preview and download. If the decoded bytes start with something else, for example the PNG signature, you get a clear "not a PDF" message instead of a broken file. Because decoding uses your browser's own routines, even multi-megabyte documents are processed locally and never leave your device.

Common Use Cases

  • Opening a PDF that an API returned as a Base64 field in a JSON response.
  • Verifying a Base64 PDF payload from a webhook before storing it.
  • Extracting a document embedded as a Data URI in an HTML or XML file.
  • Double-checking that a Base64 string really contains a PDF and not a renamed image.

FAQ

Can I convert Base64 to PDF without uploading anything?
Yes. Decoding, validation, preview and download all run in your browser. Your Base64 data and the resulting PDF are never sent to a server.
How do I know if my Base64 string contains a PDF?
A Base64-encoded PDF always starts with JVBERi0, because every PDF begins with the bytes %PDF-. This tool checks that file signature for you and shows the detected type in the inspector.
Does this tool accept a PDF Data URI?
Yes. Paste the full data:application/pdf;base64,... string and the prefix is parsed and removed automatically before decoding.
Why is my Base64 invalid for this tool?
The most common causes are missing padding, URL-safe characters (- and _), or stray whitespace copied with the string. The error message names the exact problem and offers a one-click fix; for a full diagnostic report, run the string through the Base64 Validator.
Is there a file size limit?
There is no hard limit — the constraint is your device's memory, since everything is processed locally. PDFs of a few megabytes convert instantly; very large files may take a moment to preview.

Related Tools