Base64 Encoder / Decoder
Encode and decode Base64 and Base64URL locally in your browser.
String to base64
Base64 to string
Runs locally in your browser. Your input is not uploaded or stored. You can verify this in your browser’s network panel.
What does this tool solve?
Base64 turns arbitrary bytes into safe ASCII text. Paste text to encode it, or paste Base64 to decode it back. Turn on URL-safe mode to get the Base64URL alphabet (- and _) with padding removed, as used in JWTs.
What examples should you start with?
Encode text
Input
Hello, world
Output
SGVsbG8sIHdvcmxk
Decode Base64
Input
aGVsbG8=
Output
hello
Base64URL (URL-safe)
Input
Binary bytes 0xFB 0xFF 0xFE
Output
-__- (standard Base64 would be +//+)
How does it work?
Encoding maps every three bytes to four characters from a 64-character alphabet; decoding reverses it. Text is first encoded as UTF-8, so non-ASCII input like Chinese or emoji round-trips correctly.
Base64URL swaps + and / for - and _ and usually drops the = padding so the result can sit safely inside URLs and tokens.
What are the edge cases and limits?
- Base64 is encoding, not encryption — never use it to protect secrets.
- Decoding requires the correct alphabet; enable Decode URL safe for the URL-safe alphabet. Whitespace and other invalid characters are rejected.
- A length that is 1 mod 4 is always invalid Base64 and is reported as truncated input.
- Padding (=) is optional when decoding; standard encoding always includes it.
Technical reference
Related tools
- URL Encoder / DecoderEncode and decode URL components and query strings safely.
- JWT DecoderDecode JWT headers and payloads locally — no signature verification.