Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text. UTF-8 safe.
- base64
- encode
- decode
- btoa
- atob
About Base64 Encoder / Decoder
Base64 is the standard way to represent binary data — or any text containing tricky characters — using only 64 printable ASCII letters, digits, plus, and slash. It's how images get embedded in CSS data URIs, how email attachments survive being routed through old mail servers, and how JWT headers and payloads are encoded for transport over HTTP.
This encoder/decoder handles full UTF-8 text correctly — emojis, accented characters, and non-Latin scripts round-trip without garbling — and supports the URL-safe variant (RFC 4648 §5), which swaps the / and + characters for _ and - and drops the trailing = padding, so the encoded output can be dropped directly into a URL or filename without further escaping.
How to use
Use the Encode/Decode toggle at the top to pick a direction. In encode mode, type or paste your plain text into the input and the Base64 output appears below. Tick "URL-safe" if the result needs to go into a URL or filename — that swaps / and + for _ and -, and removes padding.
In decode mode, paste a Base64 string in and the decoded text appears below. The decoder accepts both the standard and URL-safe alphabets, with or without padding, so you can paste a Base64 value from almost anywhere. If your input isn't valid Base64, you'll see an error in red instead of a result.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption — it's a public, reversible transformation any system can decode without a key. It exists to safely transport binary or unusual characters through systems that expect plain ASCII, not to keep data secret. Never rely on Base64 for security.
What's the difference between standard and URL-safe Base64?
Standard Base64 uses the alphabet A–Z, a–z, 0–9, +, /, with = as padding. URL-safe Base64 (RFC 4648 §5) swaps + for - and / for _, and usually drops the = padding — so the result can be dropped into a URL or filename without further escaping. JWTs use URL-safe Base64 for their header and payload.
Why does the encoded output get longer than the input?
Because Base64 encodes every three bytes of input as four characters of output, plus padding — a 33% size increase. That overhead is the cost of being able to round-trip arbitrary bytes through text-only channels like email headers, JSON strings, and URLs.
Does Base64 handle emojis and non-Latin text?
Yes. The encoder treats text as UTF-8 bytes, then Base64-encodes those bytes. So emojis, Cyrillic, Chinese characters, accented letters — all round-trip cleanly. The decoder reverses the same process, recovering the original UTF-8 string.