# Base64 to PDF

Paste base64 and get the PDF back, previewed before you save it. The format is read from the bytes. Nothing you paste is uploaded.

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

## 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: Base64 in, with or without a data: prefix, in the standard or URL-safe alphabet. PDF out.
- Limits: Held in memory, so a very large payload is limited by the browser. A payload that decodes to something other than a PDF is named rather than saved.
- 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

### Why does an API give me a PDF as base64 at all?

Because JSON carries text and nothing else. A generated invoice, report or signed document has to become text to travel inside a JSON field, and base64 is the standard way to do that. What you are pasting is the file, spelled out in 64 characters.

### How do I know it is really a PDF before I save it?

The decoded bytes are checked for the %PDF- header that begins every PDF file, and the result is rendered in your browser's PDF viewer on this page. So you see the document before it reaches your disk rather than finding out afterwards.

### Does the data: prefix need to be there?

No. Paste the bare payload or the whole data URL, whichever you copied, and the line breaks that a terminal or a JSON file leaves in are stripped. What is decoded is the payload, and where it came from makes no difference.

### Is the PDF uploaded to preview it?

No. It is turned into a local object in your browser and handed to the viewer that is already built into it. Nothing crosses the network, which matters because a base64 PDF from an API is usually an invoice, a statement or a signed agreement.

### What if my base64 is truncated?

You get told, rather than getting a file. Base64 has a length that must be a multiple of four once padding is counted, so a copy that missed the end fails to decode and the page says so. A PDF that decodes but was cut short will open with its pages missing, which the preview shows you.

## Related tools

- [PDF to Base64](https://filetity.com/pdf-to-base64): Turn a PDF into base64 text for an API or a JSON field.
- [Base64 to Image](https://filetity.com/base64-to-image): Paste base64 or a data URL and get the picture back.
