Base64 Encoder and Decoder
Encode any text to Base64 or decode a Base64 string back to readable text. Accented letters, Urdu, Arabic, Chinese and emoji are handled correctly through UTF-8, and you can switch to the URL-safe alphabet used in JWTs and web links.
Convert Base64
How Base64 works
Base64 (RFC 4648) turns binary data into 64 safe text characters. The input bytes are taken three at a time (24 bits) and split into four 6-bit groups; each group becomes one character. If the input isn’t a multiple of three bytes, = padding is added.
Size
Encoded length = 4 × ⌈bytes ÷ 3⌉ characters (about 33% larger)Worked example
- Bytes: 77, 97, 110 → bits 01001101 01100001 01101110
- 6-bit groups: 010011 010110 000101 101110 → 19, 22, 5, 46
- Characters: T, W, F, u → TWFu
Base64 alphabet
| Values | Characters |
|---|---|
| 0–25 | A–Z |
| 26–51 | a–z |
| 52–61 | 0–9 |
| 62 | + (URL-safe: -) |
| 63 | / (URL-safe: _) |
| Padding | = |
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode Base64, so never use it to hide passwords or personal data. It is only a way to carry binary data in text, for example in email attachments, data URLs and JSON.
Why does decoding show an error?
The input contains characters outside the Base64 alphabet, has the wrong length, or decodes to binary data (such as an image) rather than text.
Is my data uploaded?
No. Encoding and decoding run in your browser.
