PDF

PDF ↔ Base64

Drop a PDF to get its Base64 representation, or paste Base64 to preview and download the PDF.

Mode

Drop a PDF here or click to choose

What is PDF to Base64 Encoding?

Base64 encoding a PDF converts the binary PDF data into a plain-text string that can be embedded in JSON payloads, data URIs, email attachments, or API requests that only accept string values. Decoding reverses the process, turning the Base64 string back into a downloadable PDF file.

How to encode a PDF to Base64 online

  1. Upload your PDF file.
  2. The Base64-encoded string appears in the output panel.
  3. Copy it for use in your JSON payload or API request.
  4. To decode: paste a Base64 string and click Decode to download the PDF.

Frequently Asked Questions

How do I embed a PDF in an HTML page using Base64?

You can use a data URI: <embed src="data:application/pdf;base64,JVBERi0x..." />. However, for large PDFs this is impractical — use an iframe pointing to a URL instead.

Why is the Base64 output so much larger than the PDF?

Base64 encoding increases file size by approximately 33% because it represents every 3 bytes of binary data as 4 ASCII characters.

Is it safe to encode a PDF to Base64?

Yes. Base64 is only encoding — the PDF content is unchanged. Anyone with the Base64 string can decode it to recover the original PDF.

What is a data URI?

A data URI embeds file data directly in a URL as text, letting you include files inline in HTML or CSS without a separate network request.