Encode a PDF file to Base64 in your browser — for data URIs, JSON payloads and API requests. No upload, no signup. No upload — runs 100% in your browser
Base64 is how binary data travels through channels that only understand text. Embedding a PDF in a JSON API payload, building a data: URI so a viewer opens the file inline, passing an attachment to a system that expects a string field — all of those need the file's bytes expressed as safe text characters. This page encodes your PDF locally and hands you the string, with or without the data:application/pdf;base64, prefix depending on where it is headed.
Base64 packs 3 bytes into 4 characters, so the output is always roughly a third larger than the input. There is no compression and no way around it — the number shown in the result line is the honest size your payload will be. For files that will be sent repeatedly, upload the binary once and reference it; reserve Base64 for genuinely inline uses.
No. Everything on this page runs inside your browser using JavaScript and WebAssembly. Your file never leaves your device — you can even disconnect from the internet after the page loads and the tool still works.
Base64 stores 3 bytes of binary in 4 characters of text, so output is about 33% larger than the input. That is inherent to the encoding, not a setting.
It turns the Base64 into a string you can paste directly into an HTML href, CSS url() or JSON field — anything that expects an inline file reference instead of a separate upload.
No hard limit — encoding happens in your browser's memory. Files of tens of MB encode fine; the output textarea with a copy button is the practical interface for large results.