Base64 encoder & decoder
Encode text, hex or a file to Base64, or decode Base64 back to text or hex. Choose the standard or URL-safe alphabet, keep or drop padding, and wrap long output. All processing happens in your browser.
Bytes in, Base64 out.
Input
Alphabet
Output
Input
Text is encoded as UTF-8. A file is encoded exactly as it is on disk, up to 10 MB.
Base64
Nothing entered
Notes on this input
Notes
- What is the difference between standard and URL-safe Base64?
- They differ in two characters. Standard Base64 (RFC 4648 §4) uses "+" and "/", which are not safe in a URL or a filename. URL-safe Base64 (§5) replaces them with "-" and "_" so the string can be dropped into a query string or a JWT unescaped. Decoding here accepts either, so you rarely have to know which one you were handed.
- Why can I turn padding off?
- The trailing "=" characters pad the output to a multiple of four so a decoder knows where it ends. Many transports — JWTs above all — drop the padding because the length is already known. The decoder accepts padded and unpadded input equally; the toggle only affects what encoding produces.
- It says the input is not valid Base64. Why is one bad character fatal?
- Unlike hex, Base64 packs three bytes into four characters, so every character sets the value of the bytes around it. Silently dropping a stray character would shift every following character into the wrong 6-bit group and decode to plausible-looking wrong bytes. It is safer to stop and point at the character than to hand back a wrong answer. Whitespace and line breaks are ignored, because wrapped Base64 is normal.
- Does anything leave my browser?
- No. There is no backend and no analytics on this page. Everything is encoded and decoded in the tab and is gone when you close it.
These are debugging aids, not certified reference implementations. If a tool disagrees with your specification, trust the specification.