Base64 to PDF.
Decode it, read it, save it.

Paste a base64 string or a data URL and see the PDF inside it straight away, then download it. Decoding happens in your browser, so the payload never leaves the tab.

Base64 input

0 chars

Supports both raw Base64 strings and data URLs starting with data:application/pdf;base64,

PDF preview

Waiting

Your PDF appears here once the string decodes.

At a glance

Price
Free
Account
Not needed
Where it runs
Your browser
Input
Base64 string or data URL
Output
PDF preview and download
Retention
Nothing is uploaded

How to decode base64 into a PDF

  1. 1Copy the base64 string, with or without the data:application/pdf;base64, prefix.
  2. 2Paste it into the box.
  3. 3The decoded PDF appears in the preview.
  4. 4Press Download to save it as a file.

Why APIs return base64

JSON cannot carry raw bytes, so an API that returns a PDF inside a JSON response has to encode it as text first. Base64 is the usual choice. It grows the payload by about a third, which is why most APIs, this one included, also offer a binary response when you do not need the rest of the JSON.

Debugging a broken payload

A valid PDF starts with JVBERi0 once encoded, which decodes to %PDF-. If your string starts with something else you are probably looking at a different file type, a double-encoded string, or JSON that still has its quotes attached. Whitespace and newlines inside the string are fine and get stripped.

Base64 to PDF: common questions

Is the base64 I paste sent anywhere?

No. It is decoded in your browser with atob and rendered locally, which is the point: these payloads usually contain real documents.

Do I need to remove the data URL prefix?

No. A leading data:application/pdf;base64, is stripped for you, and so is any other data: prefix.

How do I know the string is a PDF?

Encoded PDFs begin with JVBERi0, which is %PDF- in base64. If yours begins with something else, it is likely a different format.

Why is my base64 longer than the file?

Base64 encodes three bytes as four characters, so an encoded file is about 33 percent larger than the original.

Is there a length limit?

Only what your browser can hold. Very large strings may be slow to paste, but they decode fine.

Can I go the other way, PDF to base64?

The API returns base64 by default, so generating a PDF through it gives you an encoded string without a separate step.

Need this inside your own app?

The same engine runs behind the html4pdf API: post HTML, a URL or a JSON template and get a PDF back in the same request. Nothing is stored on our side. New accounts get 10 free credits.

Get API key

Other free tools