Base64 Encoder & Decoder

Easily encode normal text into Base64 format or decode a Base64 string back to its original text. This tool fully supports UTF-8 characters (like emojis and accents).

What is this tool?

The Base64 Encoder & Decoder is a developer-focused utility that translates human-readable text (and other data) into a standardized ASCII string format, and vice-versa. Base64 is not an encryption method; rather, it is an encoding scheme used universally across the internet to ensure that data remains intact without modification during transport.

This tool is built with a robust, client-side decoding and encoding engine that properly handles full UTF-8 character sets. Unlike basic Base64 tools that crash when encountering emojis, Asian characters, or accented letters, this utility safely escapes and processes all modern web characters. Everything runs locally in your browser to guarantee your data's privacy.

How to Use

  1. 1

    Input your text

    Paste the text or the Base64 string you want to process in the input box.

  2. 2

    Choose the action

    Click 'Encode to Base64' if you pasted normal text. Click 'Decode to Text' if you pasted a Base64 string.

  3. 3

    Copy the result

    The processed text will appear in the corresponding box. Click the copy button to save it to your clipboard.

The Science & Logic Behind It

At a technical level, Base64 encoding takes binary data and translates it into a radix-64 representation. The "64" refers to the specific alphabet used: 26 uppercase letters (A-Z), 26 lowercase letters (a-z), 10 numbers (0-9), and two symbols (usually + and /). The equals sign (=) is used as a padding character at the end of the string.

The process works by taking three 8-bit bytes of the input data (24 bits total) and dividing them into four 6-bit chunks. Each 6-bit chunk has a numerical value between 0 and 63, which maps directly to one of the 64 characters in the Base64 alphabet.

Because 3 bytes of input become 4 bytes of output, Base64 encoding increases the size of the data by approximately 33%. Despite the size increase, it is crucial for transmitting data over protocols that were originally designed to handle only text (like HTTP, SMTP, or JSON), as it prevents special control characters in binary data from breaking the transmission.

Practical Use Cases

  • Embedding Images in HTML/CSS: Developers often convert small icons or images to Base64 strings (Data URIs) to embed them directly into HTML or CSS files, saving an HTTP request and improving page load times.
  • Sending Email Attachments: The SMTP protocol used for email was originally designed for text. When you attach a file to an email, your email client encodes the file into Base64 so it can safely travel through text-based servers.
  • JSON Data Transmission: APIs that use JSON cannot transmit raw binary data (like a PDF file or an audio clip). The binary data must be converted to a Base64 string before being placed inside a JSON payload.
  • Basic HTTP Authentication: The Authorization header in basic HTTP auth transmits the username and password combined with a colon, encoded in Base64 (e.g., Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=).

Frequently Asked Questions