Skip to content
Convertto

PDF to Base64 Converter

Encode a PDF as a Base64 string or a data URI, ready to embed in code.

To convert a PDF to Base64, add the file and its bytes are encoded in your browser. Choose a raw string, a `data:` URI you can drop straight into an <embed> or an email template, or the URL-safe alphabet for use in a query string. Base64 grows the file by about a third, so a 4 MB PDF becomes roughly 5.5 MB of text.

Runs in your browser
Size
Base64 is about 33% larger than the original bytes
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Why is the output so much bigger than my PDF?

Base64 represents three bytes as four characters, so the text is about 33% larger than the file. That is inherent to the encoding, not to this tool.

Which variant should I use?

A data URI to embed the document directly in HTML or CSS. Raw Base64 for a JSON payload. URL-safe when the string goes into a query parameter or a filename, since "+" and "/" have meaning there.

How to use the pdf to base64 converter

  1. 1Select your pdf file — the file stays on your device and is never uploaded.
  2. 2Choose the output as.
  3. 3Press Run, then download the result when it is ready.

Embed this tool

Put the working pdf to base64 converter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More encoders & decoders