Base64 Encode & Decode
Turn text into Base64 and back, with full Unicode support.
How to use the Base64 Encode & Decode
- Type or paste text to encode, or paste a Base64 string to decode.
- Leave the mode on Auto-detect, or force Encode or Decode.
- Turn on URL-safe output or 76-character line wrapping if your target needs it.
- Copy the result or save it as a text file.
Examples
About this tool
Base64 represents any bytes using only 64 printable characters (A-Z, a-z, 0-9, + and /). It lets binary or non-English text travel safely through systems that only expect plain ASCII, such as email bodies, JSON fields, data URLs, HTTP headers and configuration files. Every 3 bytes become 4 characters, so encoded data is about a third larger than the original.
This tool converts text to UTF-8 bytes before encoding, so accented letters, Chinese characters and emoji survive the round trip intact, which the browser's built-in btoa function cannot do on its own. When decoding it ignores spaces and line breaks, accepts both the standard and URL-safe alphabets, and adds back any missing = padding for you.
Tip: if a decoded result looks like gibberish, the original was probably binary data such as an image or a compressed file rather than text. Base64 is an encoding, not encryption, so never use it to hide secrets.
Frequently asked questions
Is my data uploaded anywhere?
No. Encoding and decoding run entirely in your browser with JavaScript. Nothing you paste is transmitted, so it is safe to use with tokens or private data.
What is URL-safe Base64?
It swaps + for - and / for _ so the result can be placed in a URL or filename without escaping. It is often written without = padding. JSON Web Tokens use this variant.
How does auto-detect decide?
If the input contains only Base64 characters, has a plausible length and decodes to valid UTF-8 text, it is decoded. Otherwise it is encoded. Pick a mode explicitly if you want to be sure.
Why does decoding fail with "not valid UTF-8"?
The Base64 is fine, but the bytes inside are not text. It is probably an image, PDF or other binary file. Use a file-based tool to turn it back into a file.
Is Base64 encryption?
No. Anyone can decode it instantly. It only changes how data is written, not who can read it.