How to use the Base64 tool
Base64 is a way of representing binary data as plain ASCII text. It is used everywhere: email attachments, data URLs in HTML and CSS, JSON Web Tokens, and APIs that require binary content inside text protocols.
To encode, type or paste your text and press the Encode button. The tool converts the text to its UTF-8 bytes, then maps those bytes to the Base64 alphabet. Because it works with UTF-8 rather than the older Latin-1 approach, characters such as emoji and Chinese render correctly — the string 你好 encodes to 5L2g5aW9, not to a mangled fallback.
To decode, paste a Base64 string and press Decode. The tool validates the input first: if it contains characters outside the Base64 alphabet, has the wrong length, or has incorrect padding, it shows a clear error instead of silently producing garbage or throwing an unhandled exception. This is important when you are copying tokens from logs or emails, where stray whitespace or line breaks are common.
Tips
- Leading and trailing whitespace and newlines are ignored during decoding, so multi-line pastes work.
- Encoding is case-sensitive and uses
+,/, and=padding; a URL-safe variant uses-and_instead. - Base64 output is about 33% larger than the original text, since every three bytes become four characters.