Base64 Encode & Decode
Convert text to Base64 and back, with full Unicode and URL-safe support. Runs offline in your browser.
Encode text to Base64 or decode Base64 back to text, with full Unicode support and a URL-safe option. Runs entirely in your browser, so tokens, credentials and payloads you are debugging are never transmitted anywhere. Emoji, accented characters and non-Latin scripts round-trip correctly, which the browser console's own btoa() cannot do.
Text is encoded as UTF-8 first, so emoji, accents and non-Latin scripts round-trip correctly — the raw btoa() in your browser console throws on those. Decoding accepts both standard and URL-safe input, with or without padding.
How Base64 Encode & Decode works
Base64 solves one specific problem: moving binary data through a channel that only reliably carries text. It takes three bytes at a time and re-expresses them as four characters drawn from a 64-character alphabet — A–Z, a–z, 0–9, plus `+` and `/` — with `=` used as padding when the input length is not a multiple of three. That is why Base64 output is always about 33% larger than the input: you are spending four characters to carry three bytes.
It shows up constantly: email attachments (MIME), data URIs that embed an image directly in HTML or CSS, HTTP Basic Authentication headers, the header and payload sections of a JWT, certificates in PEM format, and binary blobs stashed inside JSON.
The most important thing to understand is that Base64 is **not encryption**. It is an encoding, with no key and no secret. Anyone who sees a Base64 string can decode it instantly — this page does exactly that. If you find credentials Base64-encoded in a config file or an HTTP header, treat them as being written in plain text, because in every meaningful sense they are.
The Unicode handling deserves a mention because it trips people up. The browser's built-in `btoa()` only accepts Latin-1 characters and throws on anything else, which is why encoding an emoji or a Hindi string in the console fails. This tool encodes to UTF-8 bytes first and then applies Base64, so any text round-trips faithfully. Decoding reverses that, and if the decoded bytes are not valid UTF-8 — because the input was genuinely binary, like an image — you are told so rather than shown mojibake.
The URL-safe variant (RFC 4648 §5) swaps `+` and `/` for `-` and `_` and drops the padding, because the standard characters have special meaning inside URLs. Decoding here accepts both variants automatically and re-adds any missing padding.
How to use Base64 Encode & Decode
Choose encode or decode
Switching mode feeds the current result back into the input, so you can verify a round trip immediately.
Paste your text
Type it, paste it, or open a text file. For decoding, both standard and URL-safe Base64 are accepted, with or without padding.
Copy the result
Copy to clipboard or download as a text file.