Base64 encoder and decoder
Paste text to get its Base64 form, or switch to Decode and paste Base64 to read the original. Non-English letters and emoji are encoded as UTF-8, and nothing leaves your browser.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Choose Encode or Decode.
- Paste your text or Base64 in the input box. The result updates as you type.
- For links, file names or JWT-style tokens, turn on URL-safe.
- Copy the result.
How it works
The text is first converted to bytes with UTF-8. Every 3 bytes (24 bits) are split into four 6-bit groups, and each group picks one character from the alphabet A–Z a–z 0–9 + /. When the last group has only 1 or 2 bytes, the output is padded with one or two = signs.
Example: foobar is the bytes 66 6F 6F 62 61 72, and it encodes to Zm9vYmFy. fo has only two bytes, so it becomes Zm8=.
Tips and common mistakes
- Encoding
é gives w6k= because UTF-8 stores it as two bytes (C3 A9). Tools that use Latin-1 produce a different, shorter result.
- A string that ends in
== or = is padded Base64; URL-safe Base64 usually has no padding, and this decoder accepts both.
- Decoding fails if the bytes are not text. Files and images need a tool that keeps them as bytes rather than showing them as text.
Frequently asked questions
What is Base64 used for?
Base64 writes any bytes using only 64 safe printable characters, so binary data can travel through text-only channels such as JSON, e-mail, HTML data URLs and HTTP headers. It makes data about a third larger.
Is Base64 encryption?
No. Anyone can decode it instantly, so it hides nothing. Never use it to protect passwords or secrets.
What is URL-safe Base64?
It is the variant from RFC 4648 section 5. The characters + and / are replaced with - and _, and the trailing = padding is dropped, so the result can be used in a URL or file name without escaping.
Why does decoding fail with a valid-looking string?
Common causes are characters outside the Base64 alphabet, a length that cannot occur (one character more than a multiple of four), or bytes that are not UTF-8 text. Spaces and line breaks are ignored, and both the standard and the URL-safe alphabets are accepted when decoding.
Is my text sent to a server?
No. Encoding and decoding happen in your browser.