Zloweb
RU

What is Base64?

Represent arbitrary bytes using a small text alphabet.

Bytes and the alphabet

Base64 groups input into blocks of three bytes. A full 24-bit block becomes four six-bit values, each mapped to a character. The standard alphabet includes letters, digits, plus and slash. If the last block is short, the standard padded form uses one or two equals signs.

hello  →  aGVsbG8=

URL-safe form and overhead

The URL-safe alphabet uses hyphen and underscore in place of plus and slash. A protocol may allow padding to be omitted. For long inputs the encoded representation is roughly one-third larger than the original bytes. Anyone can reverse Base64; it provides no secrecy.

Round-trip UTF-8 text

Encode a phrase containing an accent or Cyrillic letters, copy the result and decode it. The converter first represents text as UTF-8 bytes. A valid Base64 string can contain arbitrary binary bytes, so decoding it as text may produce a UTF-8 error.

Try the tools

Related reading

References