Free Base64 to PDF decoder
Base64 to PDF decoder and download it free
Got a PDF as a long Base64 string from an API, a JSON field, an email or a log? Paste it, see the file name, size and pages, and save a real PDF. Decoding happens in this tab.
- Free, no sign-up
- Your string never leaves this tab
- Checks the %PDF signature
From a wall of characters to a PDF you can open
One screen: paste on the left, read the verdict on the right, save the file.
- Step 01
Paste the string as you got it
Line breaks, spaces and a data:application/pdf;base64, prefix are fine. Not sure what you have? Press Paste example first.
- Step 02
Read the verdict before you save
A valid PDF shows its file name, size in KB and page count. Anything else gets a plain reason, such as not valid Base64 or not a PDF.
- Step 03
Download, or copy the clean string
Download PDF saves the file. Copy puts the cleaned Base64 on your clipboard, and Clear wipes the field and the saved draft.
What you get besides a download
- Accepts raw Base64 and full data URIs without any manual trimming
- Understands the URL-safe alphabet and strings that lost their = padding
- Confirms the decoded bytes really start with %PDF before offering a file
- Shows size in KB and the number of pages at a glance
- Copy gives you the cleaned string, ready to paste into a request or a test
- Clear resets the field, the result and the saved draft in one click
- Free download with no account and no watermark
- Nothing is uploaded: the file is built from a Blob on your device
What counts as valid Base64 for a PDF
Base64 writes binary data using 64 safe characters: the letters A to Z and a to z, the digits 0 to 9, plus and slash. Every four characters carry three bytes, and the equals sign at the end pads the last group. A PDF encoded this way is about a third larger than the file itself, which is why a one-page document can turn into thousands of characters.
A data URI wraps the same string with a label, for example data:application/pdf;base64, followed by the characters. Browsers and many APIs produce it. The decoder cuts that label off, because it is not part of the data. It also removes spaces, tabs and line breaks, since email clients and terminals often wrap long lines at 64 or 76 characters.
URL-safe Base64 swaps the plus for a hyphen and the slash for an underscore so the string can sit inside a web address or a token. Many systems also drop the trailing equals signs. The decoder maps the characters back and restores the missing padding, so these variants decode to the same file as the standard form.
After cleaning, the string is checked. Any character outside the alphabet, or a length that cannot be completed, is reported as not valid Base64. A string that decodes but whose first bytes are not %PDF is reported as not a PDF, for example when the data is plain text, an image or a ZIP archive. Real PDF files begin with those four characters, followed by a version such as 1.4 or 1.7.
The page count comes from the file itself. The decoder counts objects marked as /Type /Page and ignores /Type /Pages, which describes the page tree, not a page. This works for the common layout where page objects are readable in the file. Some PDFs hide page objects inside compressed streams, so treat the number as a quick check and open the file when the exact count matters.
The cleaned string is the single source for everything on the screen. The size, the page count, the download and the Copy button all use it, so what you copy is exactly what gets decoded. The text you paste is kept in this browser so a reload does not lose it, unless it is very large, and Clear removes it.
Our test: the built-in sample
We ran the real decoder on the sample behind the Paste example button: a one-page PDF with a line of text. The numbers below are what the tool reports.
| Pasted string | 792 characters |
|---|---|
| Decoded file | 0.6 KB (593 bytes) |
| Signature | %PDF-1.4 |
| Pages | 1 |
In the same test, the string with a data URI prefix, with line breaks every 76 characters and in URL-safe form without padding each downloaded a file identical to the original.
What this decoder cannot do
- It does not draw a preview. You see the name, size and page count, then open the downloaded file in your PDF viewer.
- The input limit is about 20 MB of Base64 text, which is roughly a 15 MB PDF. Larger strings are rejected with a message.
- It does not unlock password-protected PDFs and does not repair damaged ones. If a file opens with an error, ask the sender for a fresh copy.
- It decodes one string at a time, and only into a PDF. For images or archives you need a different tool.
Base64 to PDF: your questions
Is my Base64 sent to a server?
No. Decoding runs in your browser and the PDF is built from a Blob on your device. The text you paste is stored only in this browser as a draft.
Can I paste a string that starts with data:application/pdf;base64,?
Yes. The prefix is removed automatically, along with spaces and line breaks, so you can paste whatever your API or email gave you.
Why does it say my text is not a PDF?
The string is valid Base64, but the decoded bytes do not start with %PDF. It may be an image, a ZIP file or plain text, or the string may be cut off.
What does Copy put on the clipboard?
The cleaned Base64: no data URI prefix, no spaces and no line breaks. The button shows Copied for about two seconds.
Does Clear remove my saved text?
Yes. Clear empties the field, hides the result and deletes the draft stored in your browser, then puts the cursor back in the field.
Is the download really free?
Yes. Download PDF costs nothing and needs no account, watermark or waiting timer.
Related tools
- PDF CompressorShrink PDFs in your browser with 3 levels, batch them and download.
- Image to PDF ConverterCombine JPG, PNG, WebP and more into one tidy PDF in your browser — no watermark.
- PDF MergerCombine up to 50 PDFs into one file in your browser — no sign-up, nothing uploaded.
- PDF Page RemoverPick the pages you don't need and save a clean PDF — undo and redo included, nothing uploaded.
Guides
- Keep as Text vs Numbers in Excel: Pick by Data TypeUse real numbers for sums, percentages and dates; keep text for codes like 00123. See what Toolper's Word to Excel switch does. Convert free.
- PDF Page Range Format: 1-3, 7 Syntax and Error FixesWrite a PDF page range like 1-3, 7 correctly: dashes, commas, spaces and why errors appear. Tested on 4 PDFs; try it free right in your browser.
- Undo PDF Merge Mistake: Restore Files and Order FastRemoved a file or scrambled the order? Undo it with Ctrl+Z, redo with Ctrl+Y in our free browser PDF merger. Merge tested on 2, 5 and 20 files. Try it now.
Turn that string into a file
Paste it, check the verdict and save the PDF in a few seconds.
About ToolperLast updated: Privacy