100% on-device · nothing uploaded
Base64 encoder & decoder
Convert text to Base64 and back, or drop in a file and get its Base64 (as a data URI if you want one). Unicode is handled properly, and nothing is uploaded.
How to use it
- Paste text to encode it, or paste Base64 and switch to Decode.
- For a file, pick it and copy the Base64 or the ready-made data: URI.
- Hit Copy to put the result on your clipboard.
The 33% tax, and when it is worth paying
Base64 maps every three bytes onto four ASCII characters, so output is four-thirds the size of input — 33% before padding or line breaks. RFC 4648 codifies an encoding that exists because much infrastructure was built when only 7-bit ASCII survived transit: SMTP in particular, and gateways that would strip a high bit or reinterpret a stray 0x0D.
That overhead makes inlining a data URI a trade, not a free win. A 6 KB icon becomes about 8 KB inside a stylesheet that can no longer be cached separately, cannot be lazy-loaded, and is re-downloaded whenever any other rule in the file changes. Below a kilobyte or two the saved request usually wins; above it, rarely. Compression recovers part of the difference, never all of it.
Two alphabets, and the padding that goes missing
RFC 4648 defines two alphabets. Standard Base64 ends with plus and slash, both meaningful inside a URL, so a token encoded that way arrives truncated at a query boundary or mangled. base64url substitutes hyphen and underscore, and is what JWTs and WebAuthn payloads use. The 62 alphanumeric characters are identical, so a string containing neither final symbol decodes the same under both — which is how this bug clears a test suite.
Padding is the other half. The equals sign pads output to a multiple of four and carries no data; a strict standard decoder rejects a wrong-length string, while base64url conventionally omits it and JWT segments never carry it, so a decoder insisting on padding refuses a valid token. Input is accepted here either way and in either alphabet; if a string still fails, suspect a line break from a terminal.
Questions
Does Base64 encrypt anything?
No — and this matters. Base64 is an encoding, not encryption: anyone can decode it in one step. Never use it to hide a secret.
Why do other tools mangle my accented characters?
Because the browser's raw btoa only accepts Latin-1. This tool encodes to UTF-8 first, so emoji, Cyrillic and accents survive the round trip.
Is my file uploaded?
No. The file is read locally with the FileReader API and encoded in the page. It never leaves your device.
What is a data URI?
A whole file embedded in a URL as Base64 — handy for inlining a small image into CSS or HTML with no extra request.
Updated 2026-07-20. Runs fully in your browser — nothing is uploaded.