Free Base64 Encoder & Decoder
Enter text to see its Base64 encoding
What Is a Base64 Encoder & Decoder?
A Base64 Encoder transforms binary data (images, text files, or raw bytes) into a text-only representation using a fixed set of 64 safe characters. A Base64 Decoder reverses the process, reading the text string and reconstructing the original binary content. Together, they form a Base64 Converter that ensures data remains intact when transferred over systems designed primarily for text — email, JSON structures, XML documents, or web APIs.
The tool supports two directions: Text to Base64 (encoding) and Base64 to Text (decoding). You can paste any plain text or a Base64 string, and the converter handles the rest. Because it works with UTF-8 Base64, the encoder can handle accented letters, symbols, and even emojis without corruption.
How Base64 Encoding Works
Base64 encoding takes every group of three bytes (24 bits) from the original data and splits it into four chunks of six bits each. Each six‑bit value — ranging from 0 to 63 — is then mapped to a character in the Base64 alphabet:
| Value | Char | Value | Char | Value | Char | Value | Char |
|---|---|---|---|---|---|---|---|
| 0 | A | 16 | Q | 32 | g | 48 | w |
| 1 | B | 17 | R | 33 | h | 49 | x |
| 2 | C | 18 | S | 34 | i | 50 | y |
| 3 | D | 19 | T | 35 | j | 51 | z |
| 4 | E | 20 | U | 36 | k | 52 | 0 |
| 5 | F | 21 | V | 37 | l | 53 | 1 |
| 6 | G | 22 | W | 38 | m | 54 | 2 |
| 7 | H | 23 | X | 39 | n | 55 | 3 |
| 8 | I | 24 | Y | 40 | o | 56 | 4 |
| 9 | J | 25 | Z | 41 | p | 57 | 5 |
| 10 | K | 26 | a | 42 | q | 58 | 6 |
| 11 | L | 27 | b | 43 | r | 59 | 7 |
| 12 | M | 28 | c | 44 | s | 60 | 8 |
| 13 | N | 29 | d | 45 | t | 61 | 9 |
| 14 | O | 30 | e | 46 | u | 62 | + |
| 15 | P | 31 | f | 47 | v | 63 | / |
The alphabet includes A–Z, a–z, 0–9, plus the symbols + and /. Every four‑character output block corresponds to three original bytes, which is why Base64 text is roughly the size of the source (an increase of about 33 %). This size overhead is the trade‑off for cross‑system compatibility.
Padding
When the input byte count is not a multiple of three, the encoder pads the incomplete last group with one or two = signs:
- One byte remaining → two
=added (e.g.,Hi→SGk=) - Two bytes remaining → one
=added
Padding tells the decoder exactly how many bytes to discard at the end, ensuring the original data is recovered precisely.
Using the Base64 Converter
The tool provides two straightforward modes:
Encode Mode (Text → Base64)
- Select Encode.
- Enter or paste the plain text (supports UTF‑8, including emojis).
- The Base64 Encoder immediately outputs the encoded string.
- Copy the result for use in APIs, emails, or data storage.
Decode Mode (Base64 → Text)
- Select Decode.
- Paste a valid Base64 string.
- The Base64 Decoder returns the original readable text.
- Use the decoded output wherever needed.
No manual bit‑splitting or character lookup is required; the Base64 Converter handles everything automatically, making it a reliable tool for both Base64 Encode and Base64 Decode tasks.
Practical Uses
Developers and system administrators often rely on Base64 to:
- Embed images or files inside CSS, HTML, or email attachments.
- Transmit binary data in JSON or XML payloads.
- Encode credentials in HTTP headers (Basic Auth).
- Store binary blobs in databases that only accept text.
While Base64 is not a form of encryption or a programming language, it is a widely adopted encoding scheme that solves a fundamental interoperability problem.
Why the 33 % Size Increase?
Each three‑byte group (24 bits) is expanded to four characters (32 bits of text representation). The formula for the encoded length is:
Where is the number of bytes in the source. This overhead is acceptable when system compatibility matters more than bandwidth or storage efficiency.
FAQ
1. How do I convert text to Base64?
Select the Encode mode on the converter, type or paste your text (supports UTF‑8), and the tool will instantly generate the Base64 output. Copy the encoded string for your use.
2. What is the = padding at the end of Base64 strings?
When the original data length is not a multiple of three bytes, Base64 adds one or two equals signs as padding. For example, 'Hi' (2 bytes) becomes 'SGk=', with one '=' indicating one byte of padding needed.
3. Is Base64 encoding the same as encryption?
No. Base64 is an encoding scheme, not an encryption algorithm. It converts binary data into text characters for safe transport but provides no secrecy. Anyone can decode a Base64 string back to its original form using a Base64 decoder.
4. Why does Base64 increase file size by about 33%?
Because every three bytes of input are represented by four characters in the output. The ratio is 4:3, so the encoded data is always roughly 33% larger than the original binary source.
5. Can I use this tool to decode Base64 to text with non‑English characters?
Yes. The converter supports UTF‑8 Base64, so it can handle accents, Cyrillic, Chinese, and emojis both when encoding and decoding.
How to Use
- Select Encode or Decode mode depending on whether you want to convert text to Base64 or Base64 back to text.
- Type or paste your input into the text area. The conversion happens automatically as you type.
- Copy the converted result to your clipboard with one click.