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?

Invoice and e-signature APIs love to return the document as one long Base64 string. Paste it here, with or without the data:application/pdf;base64, prefix, and the PDF opens in the right panel so you can read it before you save it.

The prefix form is a data URL; the page cuts it off and decodes what follows. If the bytes do not start with %PDF-, the page tells you it is not a PDF rather than opening a blank viewer.

Decoding is done by atob() and the preview is a Blob URL in this tab, so the document is not sent anywhere.

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":"laptop_delivery_note.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

Your OpenAPI-described billing endpoint returns the receipt for a ThinkPad order as Base64. Paste the field to check the totals and the logo before the release goes out.

Email Attachment Extraction

Raw email keeps a PDF attachment as a Base64 body part under MIME (RFC 2045). Copy the block below its headers and paste it here to get the file back.

E-Signature Workflows

E-signature APIs such as DocuSign can return the signed document as Base64. Open it here and check the signature page before your code files it away.

Kubernetes / Config Secrets

Anything put into a Kubernetes Secret comes back as Base64. If someone stored a PDF there, paste the value and see what it is.

Frequently Asked Questions

What formats does the input accept?

Raw Base64, or a full data URI that starts with data:application/pdf;base64. Line breaks, missing padding and the URL-safe - and _ characters are dealt with before decoding.

Why is the preview blank or broken?

If you see a message instead, the string is either not valid Base64 or not a PDF. If the panel stays blank with no message, your browser may not show PDFs inline; download the file and open it. To look at the raw bytes, try the Base64 Decoder.

Is my data private?

Yes. atob() decodes the string and the preview is a Blob URL created in this tab. The document never leaves your machine.

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

Pick the file on the PDF to Base64 page and it gives you the string.

Does the preview work on mobile?

It depends on the browser's own PDF viewer. Desktop Chrome and Firefox show it inline; many phone browsers do not, so use Download PDF there.

Related Base64 Tools

Going the other way, or decoding something that is not a PDF: