Base64 encoder and decoder
Paste your text or Base64 code. Everything runs in your browser: nothing is sent.
Result
U2FsdXQsIMOnYSB2YSA/Base64
- Bytes (UTF-8)
- 15
- Characters in the result
- 20
Inputs
- Action
- Encode
- Alphabet
- Standard (+ /)
- Text
- Salut, ça va ?
How it is calculated
The text is turned into UTF-8 bytes (e.g. “ç” = 2 bytes).
Result
Base64
- Bytes (UTF-8)
- 15
- Characters in the result
- 20
How it is calculated
- The text is turned into UTF-8 bytes (e.g. “ç” = 2 bytes).
- Each group of 3 bytes (24 bits) becomes 4 characters out of 64 (A–Z, a–z, 0–9, + and /). “=” pads the end.
- URL-safe variant: + becomes -, / becomes _, and trailing = are removed.
Example
“Salut, ça va ?” (15 bytes) gives U2FsdXQsIMOnYSB2YSA/.
Good to know
- Base64 is not encryption: anyone can decode it. Do not use it to hide a password.
- Text only: binary files (images…) are not handled.
When to use it
- Read the content of a Base64 field found in an email, a config file or an API response.
- Encode a short text before pasting it into a data URL or a header.
- To show a Base64 string as a picture, use the Base64 to image converter.
Frequently asked questions
Why does Base64 end with = signs?
Base64 works on blocks of 3 bytes. When the last block is short, one or two = signs fill the gap.
How much bigger is Base64 than the original?
About a third bigger, since every 3 bytes become 4 characters. Line breaks, when used, add a little more.
What is Base64url?
A variant that uses - and _ instead of + and /, so it fits in URLs and file names. It is used in JWT tokens, often without the = padding.