Base64 Encoder Decoder

Encode and decode Base64 strings.

Your text is processed in your browser.

UTF-8

Base64

Base64

UTF-8

Encode and decode Base64 strings quickly and easily. This developer utility handles all operations client-side in the browser.

How to use it

  1. Choose encoding or decoding and the character set used for the text.
  2. Paste your input. Enable line-by-line conversion only for independent entries.
  3. Convert automatically or use the action button, then copy the valid result.

How Base64 encoding and decoding work

Base64 represents bytes with a 64-character alphabet: A–Z, a–z, 0–9, + and /. It makes binary data suitable for text-based formats; it does not compress or encrypt it.

From text to Base64

The selected character set first turns text into bytes. Every three bytes provide 24 bits, regrouped into four 6-bit values. Each value, from 0 to 63, selects one character from the Base64 alphabet.

From Base64 to text

Decoding reverses these steps: Base64 characters become 6-bit values, which are joined and split back into bytes. The selected character set then interprets those bytes as text.

A worked example: Cat → Q2F0

In UTF-8, these three letters occupy one byte each. The same 24 bits appear in both tables; only their grouping changes.

1. Text and its bytes
CharacterCat
Byte (decimal)6797116
Bits (8)010000110110000101110100
2. Regrouping into Base64
Group1234
Bits (6)010000110110000101110100
Index1654552
Base64Q2F0

Cat→Q2F0

Why do some strings end with =?

If the last block contains only one or two bytes, zero bits complete the final 6-bit value. Two or one = signs complete the four-character block. These signs are padding, not characters in the original text.

C → Qw==Ca → Q2E=Cat → Q2F0

Choosing the character set

Base64 does not record a character set. Use the same one that produced the bytes: UTF-8 is the default; Windows-1252 supports a limited set of characters, while UTF-16 LE and BE differ in byte order. This tool does not insert or remove a BOM automatically.

Several independent entries

Enable line-by-line conversion for separate entries, not for one long Base64 string wrapped onto several lines. Blank lines are retained. An invalid entry reports its line number and clears the result instead of leaving a partial conversion.

Base64 is reversible without a key. Do not use it to protect passwords or secrets. This tool processes text locally in your browser; it does not decode binary files.

Frequently asked questions

Is Base64 a form of encryption?

No, and this matters: it is an encoding, reversible by anyone in one click. Never use it to hide a password or a token.

What is Base64 for?

Carrying binary data through channels that only accept text, such as data URIs in CSS, email attachments and JSON payloads.

Does it handle accents and emoji?

Yes, with UTF-8 or UTF-16. Windows-1252 has a limited character repertoire and cannot encode emoji or many other scripts; the tool reports an error instead of replacing them.

Which character set should I choose?

Keep UTF-8 unless you know the source uses another encoding. Decoding must use the same character set that produced the bytes. UTF-16 LE and BE have different byte orders; Base64 itself does not store this information.

When should I convert each line separately?

Use it for independent text entries or Base64 strings. Leave it off if one Base64 string is merely wrapped onto several lines. Blank lines are retained and invalid entries report their line number.

Recommended Tools