Free PDF to Base64 converter — drop a document in and get the encoded string, a data URI, an embed tag or a download link.
The file is read on this page. It is checked for a real
%PDF- signature first, so a document that is not actually a
PDF is caught before you encode it.
Your Base64 appears here
Drop a PDF on the left to start
No sign-up, no watermark, no limit on how many you convert.
Drop the document in and the encoded text is there. The whole conversion runs on this page, so there is no upload wait and no copy of your file sitting on somebody else's server — a PDF to Base64 converter online that never sees the document. Three steps:
<embed> tag or a ready-made download link. Whatever you need to paste into next..txt file when it is too long to hold on the clipboard comfortably.A PDF to Base64 string on its own is rarely the finished job — it is almost always about to be pasted into something. So rather than make you convert PDF to Base64 string online and then reshape it by hand, these are the shapes it offers:
| Output | Looks like | Use it for |
|---|---|---|
| Raw string | JVBERi0xLjQK… | JSON payloads, database columns, an API field |
| Data URI | data:application/pdf;base64,JVBERi0… | Anywhere a URL is expected |
| <embed> tag | <embed src="data:application/pdf;base64,…"> | Showing the document inside a page |
| Download link | <a href="data:…" download> | Offering the file without hosting it |
That data:application/pdf;base64, opening is the PDF base64 prefix
— the part that tells whatever reads it what kind of file follows. The string itself
always begins JVBERi0, which is simply %PDF- encoded, and that is the
PDF base64 header you can recognise at a glance. Any PDF base64 sample you find anywhere begins the same way.
Encoding is indiscriminate: hand it any file and it produces valid Base64. That is exactly
the problem. The 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, and the result is an HTML file wearing a PDF's clothes. Encode that and the fault is
now invisible, sitting inside a perfectly valid-looking string.
So the signature is checked before anything is encoded. If the bytes do not start with
%PDF-, the page says what they actually are — HTML, a ZIP, a Word file,
an image — rather than handing you a string that will fail somewhere further down the
line. A second check catches a PDF that was cut short mid-download, because a complete one
always ends with an %%EOF marker.
Every three bytes become four characters, so the encoded text is roughly 33% larger than the document. That is the whole story behind PDF to Base64 size increase: it is arithmetic, not a setting, and no tool can avoid it. A 1 MB PDF becomes about 1.37 MB of text, so a PDF in Base64 always weighs more than the file it came from. Turning a PDF into Base64 makes it portable, not smaller.
Base64 is an encoding rather than a compression, so nothing is squeezed and nothing is lost. Decoding gives back a byte-for-byte identical file — signatures, embedded fonts and form fields all intact, because the document is never re-rendered. The File Size and Base64 Chars figures above show both numbers side by side.
MIME — the standard behind email attachments — wraps encoded data at 76 characters per line, and some mail servers still reject a message containing longer lines. If the string is going into an email, turn the wrap on. If it is going into a data URI, a JSON field or an HTML attribute, leave it off: those need one unbroken line, and the line breaks would have to be stripped again anyway.
Searches for PDF from base64 online, PDF base64 decode online or PDF base 64 decode are asking for the opposite operation, which is a separate page: Base64 to PDF takes a string, checks it, and works as a PDF base64 viewer — the document opens in a reader before you download anything. Between the two, both directions are covered.
For other kinds of file there is Image to Base64 and Encode to Base64 for plain text. If the aim is a smaller document rather than an encoded one, a PDF Splitter will do more good than any encoder. And the full explanation of what Base64 is — including why it is not encryption — is in What Is Base64? And Why It Is Not Encryption.