Skip to main content
Preparing workspace

Base64 to PDF

Paste a Base64 string (it starts JVBERi0) or a data:application/pdf URL and get the PDF back: preview, download and a truncation check. Nothing uploaded.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Base64 to PDF

Decode a Base64 string or data URL back into a PDF, preview it, and check its version, page objects, encryption and trailer.

To turn Base64 back into a PDF, decode the text to bytes and save them as .pdf. Paste the string here, raw or as a data:application/pdf;base64, URL, and it is decoded in your browser, previewed and offered as Download PDF. PDF Base64 starts with JVBERi0, the encoding of %PDF-. Truncated or encrypted files are flagged.

How to use Base64 to PDF

  1. Paste the payload into the 'Base64 PDF data' box — raw, or a full data:application/pdf;base64,… URL. Every real PDF starts with %PDF-, which is always JVBERi0 in Base64, the box opens with a one-page sample already in it, and the limit is 40 MB decoded.

  2. There is no convert button: the decode runs as you type. The Decoded PDF panel renders the file in your browser's own PDF viewer, and the table reports PDF version, Decoded bytes, Base64 characters, Encoding overhead, Page objects found, Encrypted, Linearized (fast web view), Interactive form, Ends with %%EOF and Document title — flagging a missing cross-reference table or %%EOF marker as a probable truncation.

  3. Once satisfied, click Download PDF to save the decoded file as decoded-document.pdf, use Copy data URL or Copy summary for the clipboard, or press Reset to restore the sample PDF.

Why use Base64 to PDF

  • Structure checked, not assumed

    Header, startxref and %%EOF are all verified, so a truncated payload is caught before you download it.

  • Preview before you save

    The decoded file renders in the browser's own PDF viewer from a blob URL, so you see the pages immediately.

  • Fully offline

    Decoding uses the browser's built-in `atob`; the document is never uploaded, which matters for contracts and payslips.

Common use cases

  • Open the Base64 invoice a payment gateway returns in its JSON response, without writing a decode script
  • Check whether a PDF that arrived over an API is truncated before blaming the viewer that will not open it
  • Confirm a document is password-protected (an /Encrypt dictionary) rather than corrupt, when a customer reports it will not print

Frequently asked questions

How do I know a Base64 string is a PDF before decoding it?

Check the first seven characters: every PDF begins with the bytes `%PDF-`, which always encode to `JVBERi0` in standard Base64. If the string starts with anything else it is not a PDF — `iVBORw0KGgo` is a PNG and `JVBERi0xLjc` specifically means PDF 1.7.

Link to answer
Why does my decoded PDF open blank or refuse to open?

The usual cause is truncation: the Base64 was cut off, so the cross-reference table and the closing `%%EOF` marker are missing. ISO 32000-1 requires both, and this tool flags their absence. The other common cause is that the string was double-encoded — Base64 of Base64 — in which case the decode produces the text `JVBERi0...` rather than binary.

Link to answer
How much does Base64 inflate a PDF?

By exactly 33%, plus up to two padding characters: Base64 maps every 3 bytes onto 4 ASCII characters. A 1 MB PDF becomes roughly 1.33 MB of text, which is why APIs that return documents inline are usually capped at a few megabytes.

Link to answer
Can this tool tell me the page count?

It counts objects marked `/Type /Page` in the raw bytes, which is exact for classic PDFs. From PDF 1.5 onwards the page tree can live inside a compressed object stream (`/ObjStm`), where those tokens are not visible without full decompression — in that case the tool reports the count as hidden rather than guessing a wrong number.

Link to answer

Embed this tool on your site

Add the Base64 to PDF widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.

<iframe src="https://www.altftool.com/embed/widget/base64-to-pdf"
  title="Base64 to PDF — free AltFTool widget"
  width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
  loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base64-to-pdf?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>

Browse all embeddable widgets →