Base64 Encoder / Decoder
Encode and decode text with Base64. Supports the URL-safe variant. Unicode-aware.
This tool runs in your browser. No data leaves your device.
How It Works
Base64 is an encoding that represents binary data with 64 printable ASCII characters
(A-Z, a-z, 0-9, +, /). It expresses 3 bytes as 4 characters, which means it
causes roughly a 33% size increase.
What is it used for?
- Carrying binary data in HTTP headers (e.g. Basic Auth).
- Attachment encoding in email (MIME).
- Data URLs (
data:image/png;base64,...). - The header and payload parts of a JWT (with the URL-safe variant).
The URL-safe variant
Standard base64 uses the + and / characters, but these have special meaning in
URLs. The URL-safe variant (RFC 4648 §5):
+→-/→_=padding is usually dropped
Protocols like JWT and OAuth use the URL-safe variant.
A note on Unicode
Base64 works on bytes, not on characters. JavaScript’s btoa/atob functions, on the
other hand, misleadingly assume Latin-1; if you hand a string containing Turkish
characters or an emoji straight to btoa, you get an InvalidCharacterError.
This tool first converts the text to UTF-8 bytes and then base64-encodes it — so Turkish characters and emoji work safely.
Privacy
Encoding and decoding run entirely in your browser. The text you paste never leaves your browser.