Base64 Encoder Decoder — Free 2026
Encode text to Base64 or decode Base64 back to plain text instantly, with full Unicode and emoji support.
Result
How It Works
- Choose a direction
- Enter your text
- Copy the result
Understanding Base64 Encoding
Base64 is one of the most widely used binary-to-text encoding schemes on the web. It converts arbitrary binary data into a string of printable ASCII characters drawn from a 64-character alphabet: uppercase A-Z, lowercase a-z, digits 0-9, plus (+), and slash (/), with equals (=) used for padding. The encoding was originally designed for transmitting binary data over channels that only support text, such as email (MIME) and early HTTP protocols.
How Base64 Works
The algorithm takes 3 bytes (24 bits) of input at a time and splits them into four 6-bit groups. Each 6-bit group maps to one of the 64 characters in the Base64 alphabet. If the input length is not a multiple of 3, padding characters (=) are appended to the output. This process means that every 3 bytes of input produce 4 bytes of output, resulting in roughly a 33% size increase. Despite the overhead, Base64 is essential for embedding binary assets like images directly into HTML, CSS, and JSON without worrying about character encoding issues.
Common Use Cases
Developers use Base64 encoding for data URIs (embedding small images in CSS via url(data:image/png;base64,...)), transmitting binary payloads in JSON APIs, encoding authentication credentials in HTTP Basic Auth headers, and storing binary data in text-only formats like XML or CSV. If you work with web APIs, you may also want to check out our character counter for measuring payload sizes, or the password generator for creating strong credentials before encoding them.
Unicode and Multibyte Support
The native JavaScript btoa() function only handles Latin-1 characters (code points 0-255). This tool uses the TextEncoder API to first convert your full Unicode input (including emoji, CJK characters, and accented letters) into a UTF-8 byte array. The byte array is then converted to a binary string before applying btoa(). Decoding reverses this process using TextDecoder. This means you can safely encode strings in any language or script without errors.
Comments