Base64 Encoder & Decoder
Base64 Encoder & Decoder
Encode or decode Base64 with Unicode support.
Runs entirely in your browser
How to use this tool
- Fill in the inputs.
- Read the result.
- Copy or download as needed.
About the Base64 Encoder & Decoder
The Base64 Encoder & Decoder converts text to and from Base64, a widely used encoding scheme that represents binary or text data using only a safe set of 64 printable ASCII characters. This makes Base64 useful whenever data needs to be safely embedded somewhere that only accepts plain text, such as inside a URL, a JSON field, an email attachment, or certain configuration files.
This tool correctly supports Unicode text (including Arabic, emoji, and other non-Latin characters), which is a common stumbling block with simpler Base64 implementations that only handle basic ASCII text correctly.
Standard Base64 encoding functions in most environments, including the browser's built-in `btoa`, are designed to work with byte data that fits within the basic Latin character range, so encoding Unicode text directly can produce incorrect results or errors. This tool works around that limitation by first converting your text into its UTF-8 byte representation using `encodeURIComponent`, and then encoding those bytes with `btoa`, which correctly captures every character regardless of language or symbol.
Decoding reverses this same two-step process: it first decodes the Base64 string back into UTF-8 bytes using `atob`, then converts those bytes back into proper Unicode text using `decodeURIComponent`. If the input is not valid Base64, or if the decoded bytes do not form valid UTF-8 text, the tool will show a clear error rather than producing garbled output.
Common use cases
- Encoding text or data to safely embed within a URL, JSON payload, or configuration file.
- Decoding a Base64 string received from an API response or another system to see its actual content.
- Preparing binary-safe text representations for systems that only accept plain ASCII text.
- Testing and debugging authentication tokens or headers that use Base64 encoding, such as Basic Auth credentials.
- Encoding non-English or symbol-containing text for safe transport through systems that might otherwise mishandle special characters.
Tips and best practices
- Base64 is an encoding method, not an encryption method — it makes data safe to transport as text, but it does not provide any security or confidentiality, since anyone can decode it just as easily as it was encoded.
- If decoding fails, double-check that you have copied the complete Base64 string without any missing or extra characters, since even a single misplaced character can make the string invalid.
- This tool's Unicode-safe encoding approach ensures that non-Latin text (like Arabic or emoji) round-trips correctly through encode and decode without corruption.
- Base64-encoded data is always about 33% larger than the original data, since it trades compactness for using only safe, printable characters.