Base64 to PDF
Turn a Base64 string into a previewable, downloadable PDF, or encode a PDF file to Base64 — free, in your browser.
Base64 to PDF, and back
APIs that generate documents — invoices, receipts, signed contracts — often return the PDF as a Base64 string embedded in a JSON response, since PDFs are binary and many transport layers only handle text cleanly.
This tool decodes that Base64, confirms it's actually a PDF by its byte signature, and renders it inline for a quick look before you download it. The reverse direction encodes an uploaded PDF back to Base64.
How to convert Base64 to a PDF
- On the Base64 → PDF tab, paste the Base64 string — a valid PDF renders immediately.
- Download the decoded file with one click.
- On the PDF → Base64 tab, drop or upload a PDF to get its Base64 output.
Frequently asked questions
How does this know decoded bytes are a PDF?
Every PDF file starts with the same five-byte signature, %PDF-, followed by a version number. The decoded bytes are checked for that signature directly, rather than trusting a file extension that Base64 never carries.
Can I view the PDF before downloading it?
Yes — a recognized PDF renders inline using the browser's own PDF viewer, so you can scroll and read it before deciding to download.
Can I upload a PDF and get Base64 back?
Yes — the PDF → Base64 tab reads an uploaded PDF and produces its Base64 (optionally URL-safe).
Why would a PDF be Base64-encoded in the first place?
APIs and message queues that only carry text often embed generated PDFs — invoices, reports, signed documents — as a Base64 field in a JSON payload.
Is the PDF uploaded anywhere?
No. Both directions run entirely in your browser using local blob URLs — nothing leaves your machine.