Decode a Base64 string back into a real, previewable PDF
Paste the Base64 string
With or without the data URI prefix — standard or URL-safe Base64 both work.
It's verified as a real PDF
Checked against the actual PDF file signature, not just assumed.
Preview & download
View it right in the browser, then save it as a real .pdf file.
Paste a Base64 string or data URI and instantly get back a real, previewable PDF — handy for debugging an API response, a database-stored document, or a JSON payload that carries a PDF.
Works with raw Base64 or a full data URI (with or without the data:application/pdf;base64, prefix), and with the URL-safe Base64 variant (-/_ instead of +//, padding optional) that JWTs and many APIs actually use.
The decoded data is verified as a genuine PDF — checked against the fixed %PDF- header every real PDF file starts with — before you ever see a preview, so you know immediately if the Base64 was actually valid PDF data or something else entirely. The preview renders using your browser's own built-in PDF viewer. Everything happens locally — nothing is uploaded.
Paste the Base64 string or data URI into the box — the PDF is decoded, verified, and previewed automatically, with a Download button to save it.
You'll get a clear error explaining the decoded data doesn't have a valid PDF header, rather than a blank preview or a silent failure — this is the single most common real-world Base64-to-PDF problem, and it's checked directly rather than assumed.
Yes — Base64 has a second, URL-safe variant (using - and _ instead of + and /, usually with padding left off) that JWTs and many APIs actually produce. It's normalized automatically before decoding, so you can paste either variant directly.
Yes — it renders directly in the page using your browser's own built-in PDF viewer, the same one that opens a PDF link normally, so you can check it's the right document before saving anything.
No — decoding and verification happen entirely in your browser. Nothing you paste is sent to a server.
The most common causes: incorrect or missing padding, an invalid character outside the Base64 alphabet, or the data genuinely isn't PDF data at all (check the specific error message — it distinguishes "not valid Base64" from "valid Base64 but not a PDF"). Standard vs. URL-safe charset differences are handled automatically, so that specific mismatch shouldn't be the cause.
No artificial limit — very large Base64 strings just take a little longer to decode, since it all happens in your browser's own memory.
Yes — our PDF to Base64 tool does the reverse direction, with several output formats (Data URI, plain Base64, ready-made HTML) depending on where you need to use it.
Base64 encodes data in groups of 3 bytes to 4 characters. When the original file's length isn't an exact multiple of 3, one or two = padding characters get added at the end to keep that grouping intact — it's not meaningful data, just a legacy alignment marker. This tool accepts Base64 with or without it, since a lot of real-world sources (JWTs especially) omit it.
Standard Base64 only uses A–Z, a–z, 0–9, +, /, and = for padding; the URL-safe variant swaps in - and _ instead. Anything else — stray whitespace, line breaks, or other symbols — makes the string invalid. If your paste includes extra characters, this tool's error message will say the data failed to decode rather than silently producing a corrupted file.
No — Base64 is encoding, not encryption or hashing (it's not related to SHA-256, despite the two sometimes being confused). It's a public, fully reversible transformation with no secret key, so decoding requires no password — which is exactly what this tool does. If a PDF you received this way was meant to be confidential, treat it the same as an unencrypted attachment, not a protected one.
Python: open("file.pdf", "wb").write(base64.b64decode(b64_string)). PHP: file_put_contents("file.pdf", base64_decode($b64String)). PowerShell: [IO.File]::WriteAllBytes("file.pdf", [Convert]::FromBase64String($b64String)). All three decode the exact same way this tool does — they just write straight to a file on disk instead of showing an in-browser preview first.
Yes — completely free, no sign-up, no limits. Base64 itself is also just a public, open algorithm, not a paid format, so there's never a cost to decoding it anywhere.
The main ones: the encoded form is about 33% bigger than the original file, which is why the string you're pasting here is noticeably longer than the PDF it represents; and it provides zero security by itself — it's reversible by anyone, with no password or key involved, so it should never be treated as a way to protect sensitive data. Those trade-offs are the reason Base64 is used for transport (getting binary data through text-only channels), not for storage or confidentiality.
No — different jobs. UTF-8 encodes text; Base64 encodes arbitrary binary data (like a PDF's raw bytes, which aren't text at all) into printable characters. The one place they connect: Base64's output only ever uses plain ASCII characters, so it's automatically valid UTF-8 too — which is why a Base64-encoded PDF can be safely embedded in a JSON string or HTML page without extra escaping.
Convert a PDF file to a Base64 string, ready to embed in HTML, CSS, JSON, or an API payload. Free, works entirely in your browser.
Decode Base64 encoded strings back to image files instantly. Perfect for developers working with Base64 image data in web applications, APIs, or databases. Supports all common image formats including PNG, JPG, GIF, WebP, and BMP. Features include pasting Base64 strings (with or without data URI prefix), automatic format detection, live image preview with dimensions and file size, one-click download of decoded images, and format information display. Handles both raw Base64 strings and complete data URI format (data:image/png;base64,...). Useful for debugging API responses with Base64 images, converting database-stored Base64 images, testing Base64 image data, extracting images from JSON/API responses, and validating Base64 encoded images. 100% client-side processing ensures complete privacy - all decoding happens in your browser, data never leaves your device. No file size limits.
Convert images to Base64 encoded strings instantly for easy embedding in HTML, CSS, JSON, or any text-based format. Supports all common image formats including PNG, JPG, GIF, WebP, and SVG. Features multiple output formats (Data URI, Plain Base64, HTML img tag, CSS background-image, JSON), drag-and-drop upload, real-time preview with file information, one-click copy to clipboard, and download as text file. Perfect for web developers embedding images inline, API responses with image data, email templates, offline web apps, and reducing HTTP requests. Shows original and Base64 file sizes with increase percentage. 100% client-side processing ensures complete privacy - images never leave your device.
Format, validate, and beautify JSON data instantly. Minify JSON, fix formatting errors, and validate JSON syntax online. Perfect for developers working with APIs and configuration files.