Free Base64 to PDF converter — paste a Base64 string or a data URI, read the document here, and download the original file back.
A bare string and a full data URI both work. Quotes, src= wrappers,
line breaks, URL-safe - and _, and missing
= padding are all repaired for you.
Your PDF appears here
Paste a string and press Convert
No sign-up, no watermark, no limit on how many you convert.
Paste the string in, press the button, read the document. The whole decode base64 to pdf online step happens inside this page, so there is no upload wait and no copy of your document sitting on somebody else's server — a base64 to pdf converter free of accounts, queues and daily caps. Three steps:
data:application/pdf;base64,. Sample loads a real base64 pdf sample if you want to see the tool work first.document.pdf, Open in new tab gives you a full-window view, and the copy buttons hand you a data URI, an <embed> or an <iframe>.
Every PDF begins with the five characters %PDF- followed by a version number.
That is the base64 pdf header, and it is not optional — a file without
it is not a PDF, whatever its name says.
This matters more than it sounds. The single most common cause of a “corrupt PDF” is
a download that failed: the server returned an error page, the browser saved it under the
.pdf name anyway, and what you have is an HTML file wearing a PDF's clothes.
Encode that and you get perfectly valid Base64 containing no PDF at all. This page checks
the signature and tells you what the bytes really are — HTML, a ZIP, an image, or plain
text — instead of handing you a document that refuses to open.
| Base64 starts with | What it really is |
|---|---|
JVBERi0 | PDF — the encoded form of %PDF- |
PCF or PGh0bWw | An HTML page — usually a failed download |
UEsDB | A ZIP, which includes .docx and .xlsx |
0M8R4 | An old .doc or .xls |
iVBORw0KGgo or /9j/ | A PNG or JPEG image |
Worth knowing on its own: a base64 encoded pdf sample always opens with
JVBERi0, so you can tell a PDF string from any other at a glance, before
decoding a single byte.
Often nobody wants the file — they want to know what is in it. A string arrives from an API, a webhook or a database column and the only question is whether it is the invoice it claims to be. That makes this a base64 pdf viewer first and a converter second: the base64 to pdf preview online appears the moment you press Convert, and nothing touches your disk unless you ask for it.
The viewer is your browser's own PDF reader, so scrolling, zooming, searching and printing all work exactly as they normally do. The page count and file size beside it answer the question a filename cannot: whether you have the full document or a truncated fragment. Used as a base64 pdf validator, that takes about two seconds.
To handle base64 pdf display in html, put the data URI inside an
<embed> or an <iframe>. That is all there is to
base64 to pdf html embedding. The copy buttons write both,
already complete, which covers the usual base64 pdf viewer in html case:
<embed src="data:application/pdf;base64,JVBERi0…" type="application/pdf" width="100%" height="600"><iframe src="data:application/pdf;base64,…" width="100%" height="600"></iframe><a href="data:application/pdf;base64,…" download>Download</a>One honest warning, because it catches people out: inline PDF data URIs are not reliable. Chrome blocks top-level navigation to them, most mobile browsers refuse to render a PDF inside a page at all, and a document of any real size makes the HTML enormous — the base64 pdf mime type being correct does not change any of that. For anything beyond a small demo, serve the PDF as a file and link to it.
Worth saying plainly, because the searches suggest people arrive expecting otherwise. If you are looking for base64 text to pdf in the sense of turning a sentence into a document, this is not that tool: it is a base64 to pdf online converter for a PDF that already exists and was encoded. Paste Base64 that decodes to plain text and the page says so rather than handing you an empty document. The same goes for base64 encode to pdf online — encoding runs the other way, and Encode to Base64 is the tool for it. Some people write the name as base64 2 pdf or look for a base64 to pdf generator; it is all the same operation, and it is decoding.
Base64 is strict about length: it comes in blocks of four characters, so one missing
character breaks the tail. The usual causes are a copy that stopped short, a line-wrapped
string that lost its ends, or stray characters picked up from the surrounding code. The
harmless cases are repaired here automatically — surrounding quotes, src=
prefixes, whitespace, URL-safe - and _, and missing =
padding — and anything else gets a specific explanation rather than a generic failure.
A half-copied string is the other common case, and it is sneakier, because it does not
fail: it still starts with %PDF-, still decodes, and a lenient viewer will
happily show part of it. Every PDF ends with an %%EOF marker, so this page
checks for it and tells you the string is cut short rather than letting you download a
document that no reader will open.
A blank preview with a working download is a different problem again, and almost always an encrypted file: a password-protected PDF decodes perfectly and then declines to display. The page detects that too, so you are not left debugging a tool that is working fine.
Decoding is lossless. Base64 is an encoding rather than a compression, so the document you download is byte-for-byte the file that was encoded — signatures, embedded fonts and form fields all survive, because nothing is re-rendered. What it costs is size: four characters for every three bytes, so the base64 pdf size is always about 33% larger than the file it carries. The Base64 Chars and File Size figures above show both numbers together.
To go the other way, or to work on the document afterwards, there is Encode to Base64, PDF Splitter and PDF to Images. The full explanation of what Base64 is, and why it is not encryption, is in What Is Base64? And Why It Is Not Encryption.