How to use the Base64 Encode / Decode
- Type or paste text into the input.
- Click Encode (tick URL-safe if needed) or Decode.
- To embed a file, choose it under “encode a file” to get a data URI.
- Copy the output.
About this tool
Base64 turns arbitrary bytes into a 64-character alphabet (A–Z, a–z, 0–9, + and /) so binary data can travel through systems that only handle text: email bodies, JSON payloads, HTML attributes and HTTP headers. Every 3 bytes of input become 4 characters of output, so encoded data is roughly 33% larger.
A common bug is encoding non-English text with the browser's raw btoa(), which throws on characters like “é” or “日本”. This tool converts text to UTF-8 bytes first, so emoji and accented characters round-trip correctly.
Standard vs. URL-safe Base64
The + and / characters have special meanings in URLs, so RFC 4648 defines a URL-safe variant that uses - and _ and usually drops the = padding. JWTs use this variant. Tick URL-safe when encoding for query strings or tokens; the decoder accepts both forms automatically.
Frequently asked questions
Why is my decoded text garbled?
The original bytes may not have been UTF-8 text — for example an image or a compressed file. Decode it as a file instead.
What is the '=' at the end?
Padding that makes the length a multiple of 4. It can be safely removed in URL-safe contexts.
Is Base64 secure?
No. It offers zero confidentiality. Use proper encryption for secrets.