About
What this Base64 tool is, why it runs entirely in your browser, and the real-world edge cases it's built to survive.
Base64 is a single-purpose site: paste text or a file, get base64; paste base64, get bytes back — with Unicode, URL-safe alphabets, padding variants, data URLs, hex output and image previews all handled. No sign-up, no upload, no server round-trip.
Why this site exists
The median “base64 encoder” on the internet is a <textarea> wired to btoa() — which throws InvalidCharacterError the moment your text contains an accented character, a CJK glyph or an emoji, and silently can’t help at all with files, URL-safe strings or wrapped PEM blocks. The bugs that actually waste people’s time live at the boundaries: charsets, alphabets, padding and line wraps. This tool is built around those boundaries — TextEncoder/TextDecoder instead of raw btoa, a decoder that accepts both alphabets and tolerates missing padding while saying what it repaired, and error messages that point at the exact offending character instead of shrugging.
How it works
Everything runs in JavaScript inside your tab. Encoding converts text to UTF-8 bytes and packs them three-at-a-time into the 64-character alphabet (standard +/ or URL-safe -_, padding optional), or into hex, or wraps the result in a data:<mime>;base64, URL using your file’s real MIME type. Decoding strips whitespace, accepts either alphabet, auto-detects and removes a data: prefix — percent-encoded forms included — and decodes to bytes. Valid UTF-8 shows as text; anything else shows as hex, with a live preview when the magic bytes say it’s an image, and a Download that names the file from a sniffed signature (png, jpg, pdf, zip, …).
The strictness is deliberate but honest: characters outside the alphabet, = in the middle of the data, or an impossible length ≡ 1 (mod 4) are reported with the exact position — everything else that commonly arrives “dirty” is decoded and annotated. If you’re debugging a failure rather than performing a conversion, the common-bugs guide walks the seven failure modes that matter.
Who maintains it
Base64 is maintained by a small independent team that builds focused utility sites, alongside sibling tools for JSON, regex and chmod. The standard is simple: results you could defend in a code review. Found an edge case we mishandle, or a message that’s confusing? Contact us — codec bugs get answered first.