Web & SEO

Base64 Encoder Decoder — Free 2026

Encode text to Base64 or decode Base64 back to plain text instantly, with full Unicode and emoji support.

Result

Size Change

How It Works

  1. Choose a direction
  2. Enter your text
  3. Copy the result
Advertisement
728x90 — AdSense Leaderboard

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.

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 printable ASCII characters. It is commonly used to embed images in HTML or CSS, transmit binary data in JSON or XML, and encode email attachments via MIME.
Does Base64 encoding increase data size?
Yes. Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 bytes of Base64 output because the encoding uses 6 bits per character instead of 8.
Can this tool handle Unicode and emoji?
Yes. This tool uses the TextEncoder API to convert Unicode strings (including emoji and non-Latin characters) into a UTF-8 byte array before applying Base64 encoding. Decoding reverses the process with TextDecoder.
Is Base64 the same as encryption?
No. Base64 is an encoding scheme, not encryption. It does not provide any security — anyone can decode a Base64 string. For security, use proper encryption algorithms like AES or RSA.

Comments

Advertisement
728x90 — AdSense Leaderboard