Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text — with full Unicode support and an optional URL-safe variant. Everything runs in your browser.
Output
How to use it
Base64 is a way of representing binary data — or any text — using only 64 printable ASCII characters: the uppercase and lowercase letters A-Z and a-z, the digits 0-9, and two extra symbols, usually + and /. A trailing = character pads the output to a multiple of 4 characters when needed. Rather than transmitting raw bytes, which can include control characters that some systems misread as commands, Base64 re-encodes every 3 bytes of input into 4 output characters drawn from that 64-character alphabet, so the result is guaranteed to be plain, safe text. Base64 exists because many of the channels computers use to move data were designed for text, not arbitrary bytes. Email (MIME), JSON payloads, XML documents, and many HTTP headers can break, truncate, or misinterpret raw binary — a stray control character can corrupt a message or crash a naive parser. Encoding the binary as Base64 first turns it into ordinary letters, digits, and a handful of symbols that every text-based system already knows how to carry unmodified from sender to receiver. A short example makes the mechanics concrete. Encoding the word Man — three ASCII bytes, 77, 97, 110 — Base64 groups those 24 bits into four 6-bit chunks and maps each chunk to a character from the alphabet, producing TWFu. Encoding the two-letter word Hi only supplies 16 bits, so Base64 pads the final group and appends an = character, giving SGk=. Because every 3 input bytes become 4 output characters, Base64 text is always about 33% larger than the original — a rule of thumb worth remembering before embedding large files this way. To use this tool, choose Encode to turn plain text into Base64, or Decode to turn Base64 back into readable text, then paste or type into the input box — the result appears instantly in the output box. Unicode text, including emoji and non-English scripts, is converted to UTF-8 bytes before encoding, so it round-trips correctly instead of breaking the way older btoa()-style tools do. Turn on URL-safe if the result needs to go inside a URL or filename: it swaps + and / for - and _ and drops the trailing padding. Base64 shows up constantly under the hood: data URIs embed small images, icons, or fonts directly inside CSS or HTML instead of a separate file request; HTTP Basic Authentication headers carry a username and password pair Base64-encoded; JSON Web Tokens (JWTs) encode their header and payload segments this way; and email attachments are Base64-encoded so MIME can carry binary files inside a text-only message body. It's important to be clear about what Base64 is not: it is an encoding, not encryption. Anyone can decode it back to the original text in one step with no key or password required, so never rely on it to keep data confidential — use real encryption for that.
Frequently asked questions
- Does it support emoji and non-English text?
- Yes. Text is encoded as UTF-8 first, so emoji, accents and CJK characters round-trip correctly — unlike naive btoa() which breaks on them.
- What is URL-safe Base64?
- A variant that replaces + and / with - and _ and omits padding, so the result is safe to use in URLs, query strings and filenames.
- Is my data sent anywhere?
- No. Encoding and decoding happen entirely in your browser — your text never leaves your device.
- Is Base64 encryption, or is it secure?
- No. Base64 is a reversible encoding scheme, not encryption — it has no secret key, and anyone can decode it back to the original text using this same tool or a single line of code in any language. It exists to make binary data safe to transmit as text, not to hide or protect it. For confidentiality, use real encryption such as AES or TLS instead.