Base64 Encoder/Decoder
Turn text into Base64 or decode it back. Non-English text goes through as UTF-8.
Base64 writes data using only 64 characters: letters, digits, + and /. This page turns your text into UTF-8 bytes, runs it through the browser's btoa(), and keeps the result in the page. Nothing is uploaded.
Padding and the URL-safe switch
Base64 turns every 3 bytes into 4 characters. If bytes are left over, = pads the end to a multiple of 4. Type these into the Encode tab to get the same results.
| Input | UTF-8 bytes | Result | With URL-safe on |
|---|---|---|---|
A | 1 | QQ== | QQ |
AB | 2 | QUI= | QUI |
ABC | 3 | QUJD | QUJD |
é | 2 (C3 A9) | w6k= | w6k |
€ | 3 (E2 82 AC) | 4oKs | 4oKs |
<<??>> | 6 | PDw/Pz4+ | PDw_Pz4- |
With URL-safe on, encoding swaps + for -, / for _, and drops the trailing =. Decoding with it on reverses that and restores the padding first. Use it for values without padding, such as the middle part of a JWT. To read a whole token, the JWT decoder is easier.
Building a Basic auth header
Encoding user:pass1234 gives dXNlcjpwYXNzMTIzNA==, which goes into the request as Authorization: Basic dXNlcjpwYXNzMTIzNA==. That is handy when you test an API by hand. A Kubernetes Secret value pasted into the Decode tab shows its original text.
Base64 is an encoding, not encryption. Anyone can reverse it without a key, so it cannot hide a password. Percent-encoding for URLs is a different job, handled by the URL encoder.
When decoding fails
A value containing - or _ is URL-safe and needs that option on. A data:image/png;base64, string fails even if you keep only the part after the comma, because it is image data and cannot be shown as text. A value made from non-UTF-8 text, such as Korean in EUC-KR, also fails, since decoded bytes are read as UTF-8 only. The tool takes text, not files. Live is on by default, so the output updates as you type.