Base64 turns arbitrary bytes into ASCII text. That is how images end up inside CSS, how email attachments are sent and how a lot of APIs pass binary data around. Text is converted through UTF-8 first, so Cyrillic, Kazakh letters and emoji come back intact. Plain btoa() throws on them.
The URL-safe switch produces base64url, the variant used in JWTs and URLs: + and / become - and _, and padding is dropped. The decoder accepts either variant.
How to use
- Choose Encode or Decode.
- Type the text or paste the Base64 string. To encode an image or another file, press Encode a file…
- Copy the result. For files you can copy a ready
data:URI to use in HTML or CSS.
Examples
Hello, world! → SGVsbG8sIHdvcmxkIQ==
Салам → 0KHQsNC70LDQvA==
Frequently asked questions
Is Base64 encryption?
No, it is an encoding and anyone can reverse it. Don’t use it to hide passwords or keys.
Why is the Base64 string longer than the original?
Every 3 bytes become 4 characters, so the size grows by about 33%.
What is the difference between Base64 and base64url?
base64url replaces + with - and / with _ and usually drops the = padding, so the string can go into a URL or a file name as is.