Base64 turns arbitrary bytes into a string of 64 safe ASCII characters. It’s how binary data — images, keys, file contents — travels through systems that only handle text, like JSON, email headers and data URLs.
This guide explains what Base64 is for and how to encode or decode it for both text and files.
TL;DR — Use the Base64 encoder/decoder, switch between Encode and Decode, and turn on URL-safe output when the result goes into a URL. It all runs in your browser.
What Base64 is (and isn’t)
Base64 represents every 3 bytes of input as 4 ASCII characters drawn from A–Z, a–z, 0–9, + and /, with = padding at the end. That’s a roughly 33% size increase — the trade-off for being text-safe.
It is encoding, not encryption. Anyone can decode a Base64 string in a millisecond. Never use it to hide passwords or tokens; it only makes binary data safe to transport as text.
Encoding text
Type or paste your text and switch to Encode. The tool encodes the text as UTF-8 first, so accented characters and emoji survive the round-trip. The output is your Base64 string, ready to drop into JSON, a data URL, or an HTTP header.
Encoding files
Base64 isn’t just for text. Upload a file and its raw bytes are encoded — useful for embedding a small image as a data URL, or inlining a key. When decoding, you can download the bytes back to a real file, so the round-trip is lossless.
URL-safe Base64
Standard Base64 uses + and /, which have special meaning in URLs, plus = padding that often needs escaping. URL-safe Base64 swaps those for - and _ and drops the padding, so the string can sit directly in a path, query parameter or filename. JWTs, for example, use exactly this variant.
Decode anything
Paste a Base64 string, switch to Decode, and get the original text or bytes back. If decoding fails, check for stray whitespace, a wrong character set, or missing padding — the tool flags malformed input so you can fix it fast.
Everything happens locally in the Base64 tool — your data is never uploaded.