Base64 ↔ PDF

Encode a PDF file to a Base64 string, or decode a Base64 string back into a PDF you can preview and download.

Drag & drop a PDF here

or click to pick a file, up to 25 MB file size.

Download PDF Open in new tab
Decoded PDFs will be previewed here, rendered locally from a blob URL.
How to use

Convert in 3 steps

Switch between "PDF to Base64" and "Base64 to PDF" with the tabs. Both directions run entirely in your browser, no uploads to any server.

Step 1

Pick a direction

Choose "PDF to Base64" to encode a file you have on disk, or "Base64 to PDF" to decode a string you already have and turn it back into a PDF.

Step 2

Drop a PDF or paste Base64

Drag & drop a PDF (up to 25 MB) into the upload box, or paste a Base64 string, with or without the data: URL prefix, line breaks, and padding.

Step 3

Copy, preview, or download

Copy the Base64 string, download it as a .txt file, or preview the decoded PDF right in the page and download it as a regular .pdf file.

Why use it

A safer Base64 ↔ PDF converter

Most online converters happily forward your file to a remote server. This one keeps everything local and verifies that decoded data really is a PDF before previewing it.

100% in-browser

The file you drop and the string you paste never leave your tab. No upload, no logging, no temp file on any server. Close the tab and everything is gone.

Magic-byte validation

Before previewing, the decoder checks that the bytes actually start with %PDF-. Random Base64 strings or wrong file types are rejected.

Local rendering only

The decoded PDF is rendered straight from a local blob URL in your browser's built-in viewer. Nothing is sent to a server, and the data is discarded as soon as you clear or close the tab.

Tolerant decoder

Paste with or without the data:application/pdf;base64, prefix. Newlines, spaces, URL-safe characters are all handled automatically.

Flexible output

Toggle 76-character line wrapping (MIME / email-friendly) and the data: URL prefix so you can drop the result straight into a CSS, JSON, or HTML file.

One-click download

Grab the Base64 as a .txt file, or save the decoded PDF as a regular .pdf, including opening it in a new tab if you want to use your browser's native viewer.

Who it's for

A great Base64 to PDF tool

Anywhere PDFs travel through APIs, emails, JSON payloads or databases, this is the quick converter you keep open in a web browser tab.

Backend developers

Inspect a Base64 PDF coming from an API, embed a small PDF directly in a JSON response, or quickly generate test fixtures.

Email & integration teams

Decode MIME-encoded PDF attachments straight from email source, or encode a PDF to drop into an email template, webhook, or SMTP relay payload.

Data engineers

Pull a Base64 string out of a database row or log file and instantly check whether it really is a valid PDF, instead of guessing from byte counts.

QA & support engineers

When a customer ticket includes a Base64 blob "that won't open", paste it in, hit decode, and instantly see if it's a corrupt file, the wrong type, or a real PDF.

Designers & doc teams

Embed a PDF into a static page or design tool using a data: URL, or quickly render a generated Base64 attachment HTML file.

Security-conscious users

Need to inspect a suspicious Base64 PDF file? Use this tool to render the Base64 code to PDF and download it for further analysis.