Base64 to PDF

Decode Base64 strings to PDF files: preview and download

Base64 Input

PDF Preview

Paste a Base64 string on the left to preview the PDF here

What is Base64 to PDF Conversion?

When APIs return PDFs as Base64-encoded strings, you need a reliable way to decode them back into a viewable document. This tool does exactly that: paste any Base64 string (with or without the data:application/pdf;base64, prefix) and get an in-browser PDF preview with a one-click download.

According to MDN's Data URLs documentation, Base64-encoded PDFs are commonly embedded as data URIs. Our tool handles both raw Base64 and full data URIs automatically.

Everything runs in your browser using the atob() Web API and Blob URLs: your PDF data never touches our servers.

How to Use the Base64 to PDF Converter

The preview is rebuilt on every edit and the previous blob URL is released each time, so you can paste one invoice after another without reloading the page.

1

Paste or Load Sample

Paste Base64 into the left Base64 Input panel. Accepts raw Base64 or full data URI (data:application/pdf;base64,...). Click Sample to load example. Example from API response:

{"status":"success","document":"JVBERi0xLjQKMSAwIG9iago...","filename":"subscriber_bill.pdf"}

Copy just the value of "document", not the quotes or key name.

2

View PDF Preview

The right PDF Preview panel renders the PDF as you paste. Missing padding, line breaks and URL-safe - and _ are handled for you; Base64 that is invalid, or that decodes to something other than a PDF, gets an error message instead of a preview.

3

Download PDF

Download PDF saves the same blob the preview is showing as decoded.pdf, so the file matches what you just looked at. Nothing is offered for download unless the decoded bytes carry the %PDF- header every PDF starts with. The trash-can icon clears both the input and the preview.

Common Use Cases

Debugging API Responses

When a REST API, such as invoice generation services or report APIs following the OpenAPI spec, returns a PDF as Base64, paste the response here to verify it decoded correctly.

Email Attachment Extraction

Extract PDF attachments from raw MIME-encoded emails (RFC 2045). Copy the Base64 body part and decode it here to recover the original PDF file.

E-Signature Workflows

Platforms like DocuSign return signed documents as Base64. Decode them here to review the final signed PDF before storing it in your system.

Kubernetes / Config Secrets

Kubernetes secrets store binary files as Base64. If you've stored a PDF certificate or document as a secret, decode it here to inspect the original file.

Frequently Asked Questions

What formats does the input accept?

Both raw Base64 (just the encoded string) and full data URIs (data:application/pdf;base64,...) are supported. Whitespace and line breaks are automatically stripped.

Why is the preview blank or broken?

The Base64 string may be truncated, corrupted, or not actually a PDF. Check for missing characters or try the Base64 Decoder to inspect the raw decoded content first.

Is my data private?

Yes. All decoding uses the browser's built-in atob() API and Blob URLs. Nothing is uploaded: your document stays entirely on your device.

How do I get a PDF as Base64 in the first place?

Use our PDF to Base64 tool to upload a PDF and get its Base64 representation. This is the reverse workflow.

Does the preview work on mobile?

PDF inline preview depends on the browser's built-in PDF renderer. It works well on Chrome and Firefox desktop. On mobile, the download button provides the best experience.

Related Base64 Tools

More tools to complete your Base64 workflow: