# PDF to Base64

Turn a PDF into base64 or a data URL for an API or a JSON field. Free, no signup, and the document is never uploaded.

Canonical page: https://filetity.com/pdf-to-base64

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: PDF in. Base64 text out, with or without the data: prefix.
- Limits: Base64 is about a third larger than the file, so a 3 MB PDF becomes roughly 4 MB of text. Many APIs that accept one cap well below what you would expect from the original's size.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### Which form does an API usually want?

The payload alone, without the prefix, because the receiving code knows it is getting a PDF and adds any wrapper itself. The data URL form is for putting the document directly into a link or an iframe in a page, which is a different job. Both are one click apart here.

### How much larger does base64 make it?

About a third. Three bytes become four characters, so a 3 MB PDF becomes roughly 4 MB of text. That growth is why an API accepting base64 usually has a request size limit that rejects documents you would think were comfortably small.

### Can I paste the result straight into JSON?

Yes. Base64 uses only characters that are safe inside a JSON string, so it needs no further escaping. What you may need to handle is length: some editors and some logging systems truncate very long lines, and a truncated payload decodes to nothing useful.

### Is the document uploaded to encode it?

No. It is read off your disk by the browser and encoded in the tab, with no request in the path. That is worth knowing when the PDF is a contract or a bank statement, which is most of what gets sent to an API this way.

### Should I compress the PDF first?

Usually yes, if it is going into a size-limited request. Compressing the PDF before encoding it shrinks both the file and the text by the same proportion, and it is far more effective than anything you can do to the base64 afterwards, which cannot be compressed further in any useful way.

## Related tools

- [Base64 to PDF](https://filetity.com/base64-to-pdf): Paste base64 or a data URL and get the PDF back, previewed.
- [Compress PDF](https://filetity.com/compress-pdf): Compress a PDF to a size you name, or to settings you choose.
