How to use the Base64 Encoder / Decoder
- Choose Encode or Decode.
- Paste your text or Base64 string.
- Tick URL-safe if the result will go in a URL or JWT.
- To convert a file or image, click "File to Base64".
Formula used
Every 3 bytes (24 bits) become 4 Base64 characters of 6 bits each. If the input is not a multiple of 3 bytes, = padding is added.
Worked examples
| Text | Base64 |
|---|---|
| Hello | SGVsbG8= |
| London | TG9uZG9u |
| เคจเคฎเคธเฅเคคเฅ | 4KSo4KSu4KS44KWN4KSk4KWH |
Frequently asked questions
Is Base64 encryption?
No. It is an encoding that anyone can reverse. Do not use it to hide passwords.
Why does decoding show strange characters?
The input may not be valid Base64, or it may encode binary data such as an image rather than text.
What is URL-safe Base64?
A version that replaces + with -, / with _, and removes = padding, so it works in URLs and JWT tokens.
How do I use Base64 images in HTML?
Convert the file to a data URI and use it as the src, for example <img src="data:image/png;base64,...">.
Does it support Hindi and emojis?
Yes. Text is encoded as UTF-8 first.