Convert a PDF into a Base64 string, ready to embed anywhere
Drop in your PDF
Or click to browse and select it.
Pick an output format
Data URI, plain Base64, ready-made HTML, or JSON.
Copy or download
Copy the result to your clipboard, or download it as a text file.
Drop in a PDF and get back a Base64-encoded string, in whichever format you actually need: a full Data URI, plain Base64, a ready-to-paste HTML <embed> or download link, or JSON.
Common reasons to do this: embedding a PDF directly inside an HTML page or email without a separate file request, sending a PDF through a text-only channel like a JSON API payload, or storing a small PDF inline in a database field.
Everything happens entirely in your browser — the file is never uploaded anywhere, unlike this site's other PDF tools that need real server-side processing (password protect/remove, split, merge). Base64 encoding is just reading the file's raw bytes, so no backend involved at all here.
Drop the PDF in (or click to browse), pick the output format you need, then copy or download the result — it's entirely automatic once the file is selected.
Data URI (the full data:application/pdf;base64,... string), Plain Base64 (just the encoded data, no prefix), a ready-to-paste HTML <embed> tag, an HTML download link, or JSON — pick whichever matches where you're actually going to use it.
The most common reasons: embedding a PDF directly inside an HTML page or email without it being a separate downloadable file, sending a PDF through a text-only channel like a JSON API payload or a database text field, or including a small PDF inline in a web app without extra HTTP requests.
Base64 has a fixed, unavoidable overhead: every 3 bytes of the original file becomes 4 text characters, which works out to roughly 33% larger than the source file. That's inherent to Base64 encoding itself, not something this tool adds on top.
No artificial limit is enforced — very large PDFs will just take a bit longer and produce a correspondingly large Base64 string, since everything is processed in your browser's own memory rather than uploaded anywhere.
No — the file is read directly in your browser and encoded locally. Nothing is sent to a server, which is different from this site's other PDF tools (password protect/remove, split, merge) that genuinely need server-side processing.
Yes — Base64 encoding treats the file as raw bytes regardless of what's actually inside it (text, scanned images, forms, anything else), so the conversion works identically either way.
Yes — our Base64 to PDF tool does the reverse direction, including validating that the decoded data is actually a real PDF before letting you preview or download it.
Base64 encodes data in groups of 3 input bytes to 4 output characters. When the PDF's total byte length isn't an exact multiple of 3, one or two = padding characters are added at the end to keep that 4-character grouping intact — one = means the final group had 2 real bytes, two == means it had only 1. The padding exists mainly for legacy parsers and predictable concatenation; it's not meaningful data itself, and some tools and APIs drop it entirely for the URL-safe variant.
Standard Base64 only uses A–Z, a–z, 0–9, +, /, and = for padding. The URL-safe variant swaps + and / for - and _. Anything outside that — stray whitespace, line breaks, or other symbols — makes a string invalid and unable to decode. The output this tool produces only ever uses the standard alphabet, so it's safe to paste directly into any Base64 consumer.
No — Base64 is encoding, not encryption, and it's also not hashing (the way SHA-256 is). It's a public, fully reversible transformation with no secret key, so anyone can decode a Base64 string straight back to the original PDF instantly. It solves a transport problem — representing binary data as plain text — not a confidentiality one. If the PDF is actually sensitive, encrypt or password-protect it first; our PDF Password Protector tool can do that before you encode it here.
Python: base64.b64encode(open("file.pdf", "rb").read()). PHP: base64_encode(file_get_contents("file.pdf")). PowerShell: [Convert]::ToBase64String([IO.File]::ReadAllBytes("file.pdf")). In Node.js it's just fs.readFileSync(path).toString('base64') — no library needed, though a small npm package called pdf-to-base64 wraps that same pattern if you'd rather not write it yourself (it's seen infrequent updates, so plain fs + Buffer is usually the safer long-term choice). All of these do exactly what this tool does, just from code instead of a browser.
Yes — completely free, with no sign-up, no usage limits, and no watermark on the output. Base64 itself is also just a public, open algorithm (not a paid service or licensed format), so there's never a cost to encoding or decoding it anywhere.
The main ones: it inflates the data by about 33%, which adds up fast for anything beyond a small file; if you embed the result directly in HTML or CSS, the browser can no longer cache it as a separate file, so it re-downloads with the page every time; and it provides zero security on its own — it's an encoding scheme, not an encryption scheme, so it shouldn't be mistaken for a way to protect sensitive data. None of that makes Base64 a bad choice for its actual job (getting binary data through text-only channels) — it just means it's the wrong tool for large files or for confidentiality.
No — they solve different problems. UTF-8 is a character encoding for representing text; Base64 is a way to represent arbitrary binary data (not necessarily text at all, like a PDF's bytes) using only safe, printable characters. They do relate in one specific way: because Base64's output alphabet only ever uses standard ASCII characters, any Base64 string is automatically also valid UTF-8 — which is exactly why Base64 output is safe to drop into a JSON string, an HTML page, or any other UTF-8 context without extra escaping.
Paste a Base64 string or data URI and get back a real, previewable, downloadable PDF file. 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.
Drop a PDF here, or click to browse
PDF files only