PDF to Base64 Converter

Drop a PDF and get a Base64 string — raw, or as a data:application/pdf URI. Everything runs in your browser — the file is never uploaded.

Drop a PDF here or click to browse
PDF files
BASE64
Waiting for a PDF

How to convert a PDF to Base64

Drag any PDF onto the drop zone above (or click to browse). The tool reads it locally with the browser's FileReader API and produces a Base64 string. By default you get the raw Base64 payload — ideal for JSON or a database column. Click Copy to grab it. Use the Data URI toggle to wrap it as data:application/pdf;base64,JVBERi0xLjQK…, which you can drop into an href, iframe, or embed.

Why convert a PDF to Base64?

Base64 turns binary PDF bytes into plain ASCII text, which is exactly what you need anywhere a transport only carries text:

Size warning

Base64 is ~33% bigger than the original binary, because every 3 bytes become 4 ASCII characters. A 5 MB PDF becomes ~6.7 MB of text. That overhead is fine for transport — JSON bodies, email, a quick paste — but it adds up:

Tip: Base64 size is predictable — roughly ceil(bytes / 3) * 4 characters. Use it to sanity-check against your column or payload limits before you commit.

Is this private?

Yes. The conversion happens entirely client-side in JavaScript. Your PDF is read into memory in the browser and encoded locally — it is never sent to a server. That matters for confidential PDFs like contracts, statements, or medical records: nothing leaves your machine. You can confirm it by opening DevTools → Network: adding a PDF fires no upload request.

Frequently asked questions

How do I convert a PDF to Base64?

Drop the PDF onto the converter above. It reads the file locally and outputs raw Base64 by default; toggle Data URI for the data:application/pdf;base64,… form, then click Copy.

Is it safe to convert a PDF to Base64 online?

On base64.dev, yes — everything runs in your browser. The PDF is never uploaded, so confidential documents stay on your machine.

How much bigger is a PDF after Base64 encoding?

About 33% larger. A 5 MB PDF becomes ~6.7 MB of text — fine for transport, but mind database column limits.

What is the data URI for a PDF?

It looks like data:application/pdf;base64,JVBERi0xLjQK… — the application/pdf MIME type, then ;base64,, then the encoded payload. Use it as an href, iframe, or embed source.

Need text, files, or URL-safe Base64?

The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.

Open base64.dev →