Base64 Encoder and Decoder
A Base64 encoder and decoder that gets Unicode right
Runs in your browser · nothing is uploaded
What is Base64?
Base64 represents bytes using 64 characters: upper- and lowercase letters, digits, + and /. It is used to carry binary data through text-only channels such as email attachments, data URLs and JWT tokens. Every 3 bytes become 4 characters, so output is about 33% longer than the input.
How to use
- Choose Encode or Decode.
- Paste text or a Base64 string into the input box; the result appears instantly, with the text size in bytes and the Base64 length in characters above it.
- Turn on URL-safe if you need it, then press Copy.
How it works
- Text is converted to UTF-8 bytes before encoding. A Korean syllable takes 3 bytes and most emoji take 4.
- When decoding, spaces and line breaks are ignored and missing
=padding is added automatically. Both URL-safe (-,_) and standard (+,/) input are accepted, and adata:…;base64,prefix is dropped. - If the decoded bytes are not valid UTF-8 (for example an image), you get an error instead of garbled text.
Examples
| Input | Base64 |
|---|---|
a |
YQ== |
안녕하세요 |
7JWI64WV7ZWY7IS47JqU |
中文 |
5Lit5paH |
👍 |
8J+RjQ== |
FAQ
Why do some Base64 tools fail on Chinese or emoji?
The browser's built-in btoa() only accepts Latin-1 characters, so tools that call it directly throw an error on other scripts. This tool converts text to UTF-8 bytes first, so "中文" becomes 5Lit5paH.
What is URL-safe Base64?
It replaces + and / with - and _ and drops the trailing = padding, so the result can go straight into URLs or JWT tokens.
Is my input stored anywhere?
No. Everything runs in your browser and nothing is sent to a server.
Related tools
URL Encoder/Decoder
A URL percent-encoder and decoder that handles Unicode and emoji
HTML Entity Encoder/Decoder
Encode and decode HTML entities for special and non-ASCII characters
JWT Decoder
Decode JWT header and payload and check expiry (no signature verification)
Hash Generator
MD5 and SHA hashes for text and files, computed in the browser