How to use
Paste text or choose a file
Put a value in the Input pane on the Text tab, or open the File or image tab to encode a file up to 100 MB. Try sample loads a line with an accented letter and an emoji.
Set options, then Encode or Decode
Choose the Character set, and tick URL-safe output, Each line separately or 76-character lines if you need them. Click Encode or Decode, or tick Live mode so the output follows your typing.
Copy, download or swap
Copy the result, download it as a .txt file, or click Swap to send the output back to the input. For a decoded file, check the preview, rename it and click Download file.
Why Base64 Decode and Encode
- Text and file modes, with an image preview when Base64 decodes to a picture.
- 30 character sets, plus Auto-detect for decoding.
- Live mode, per-line conversion, base64url and 76-character MIME lines.
- Runs in your browser, so tokens, credentials and files are not uploaded.
How Base64 works: Man becomes TWFu
Base64 reads the input 3 bytes (24 bits) at a time and splits those bits into four 6-bit groups. Each group is a number from 0 to 63, and each number maps to one of 64 characters: A to Z, a to z, 0 to 9, then two extra symbols.
The word Man is the bytes 77, 97 and 110, or 01001101 01100001 01101110 in binary. Regrouped into 6 bits that is 010011 010110 000101 101110, which are the numbers 19, 22, 5 and 46. Those map to T, W, F and u, so Man encodes to TWFu. If the input were only Ma, there would be 2 bytes, the last group would be padded, and the output would be TWE=.
The two extra symbols are where the standard and URL-safe versions differ:
| Base64 (RFC 4648) | base64url | |
|---|---|---|
| Characters for 62 and 63 | + and / | - and _ |
| Padding | = or == at the end | Usually left off |
| Safe in a URL as is | No, + and / need escaping | Yes |
| Typical uses | Email attachments, data URIs, Basic auth | JWTs, URL parameters, file names |
Character sets: when UTF-8 is not the answer
Base64 only carries bytes. Turning those bytes into letters needs a character set, and most modern data uses UTF-8, which is the default here. Older systems, email archives and some Windows or Japanese software used other sets, and decoding their bytes as UTF-8 gives errors or odd symbols.
Auto-detect tries UTF-8 first, then a UTF-16 byte order mark, then Windows-1252 so every byte still shows as a character. Multi-byte East Asian sets can be decoded but not encoded, because browsers only include decoders for them.
| Character set | Where you meet it |
|---|---|
| UTF-8 | Almost everything today: web pages, JSON, APIs |
| Windows-1252 / ISO-8859-1 | Old Western European text, legacy databases, some CSV exports |
| UTF-16LE | Windows internals, PowerShell -EncodedCommand values |
| Shift_JIS, EUC-JP | Older Japanese email and files (decode only) |
| GB18030, Big5 | Older Chinese text (decode only) |
| KOI8-R, Windows-1251 | Older Russian text |