iShowPDF

PDF to Base64

PDF to Base64 converts a PDF into a block of text.

What PDF to Base64 does

PDF to Base64 converts a PDF into a block of text. Developers need this to send a document through a JSON API, store it in a text field, embed it in a web page or pass it to code that only accepts strings.

Choose a PDF and the full Base64 appears at once. By default it is wrapped as a data:application/pdf;base64 link; untick 'As a data: link' to get only the Base64 characters. The header shows how large the text is. You can copy it or download it as a .txt file. Expect the text to be about a third larger than the PDF.

How to use PDF to Base64

  1. Choose your PDF

    Press Choose file and pick the document.

  2. Pick the format

    Keep the data: link for HTML, or untick it for APIs that want plain Base64.

  3. Copy or download

    Copy the text, or save it as a file named like invoice.pdf.base64.txt.

Questions about PDF to Base64

How do I send a PDF in a JSON API request?

Convert it here with the data: link turned off, then put the text in your JSON as a string value. The receiving server decodes it back into the PDF.

Why is the Base64 bigger than my PDF?

Base64 uses 4 characters for every 3 bytes, so the text is roughly 33% larger than the file.

Is my PDF uploaded to encode it?

No. The file is read and encoded on your device, and the result stays in your browser.

Can a password-protected PDF be encoded?

Yes. Encoding copies the bytes exactly, so the password protection is still there after the text is decoded.

Related tools