What Is Base64 Encoding and When Should You Use It?
Base64 is a way of writing any data using only 64 safe characters: letters, numbers, plus, and slash. It lets binary data travel through systems that only expect plain text, such as email and some web APIs.
How it works
Base64 takes the data three bytes at a time and writes each group as four characters from its alphabet. When the data does not divide evenly, the result is padded with one or two equals signs (=).
Because every 3 bytes become 4 characters, the encoded text is about 33% larger than the original.
Where you will see it
Base64 appears in many places.
- Email attachments
- Data URLs that embed small images in HTML or CSS
- JSON Web Tokens, which use a URL-safe variant
- HTTP Basic authentication headers
- API responses that carry files inside JSON
It is not encryption
Anyone can decode Base64 in a second, so it gives no protection. Do not use it to hide passwords or personal data. Use real encryption for that.
Text and Unicode
Letters outside basic English, such as accented characters and emoji, must first be turned into bytes using UTF-8 before encoding. A good tool does this for you so that decoding returns exactly the text you started with.
Try it
The Base64 Encoder and Decoder converts text both ways in your browser, with Unicode support.

