Base64 Encoder / Decoder
Encode text to Base64 or decode it back - With URL-safe mode. Runs instantly in your browser.
How Base64 Actually Works - A Worked Example
Base64 takes every 3 bytes of input and re-slices them into
4 groups of 6 bits, then maps each group to one of 64 characters
(A–Z, a–z, 0–9, +, /). Watch Hi! become SGkh:
| Text | H | i | ! | ||||
| Bytes | 01001000 | 01101001 | 00100001 | ||||
| 6-bit groups | 010010 | 000110 | 100100 | 100001 | |||
| Base64 | S | G | k | h | |||
When the input isn't a multiple of 3 bytes, = padding fills the gap -
that's why Base64 strings end in = or == so often.
It's arithmetic, not secrecy - Which is why anything sensitive needs
real encryption before encoding.
Where You'll Meet Base64 in the Wild
JWT tokens
Every JSON Web Token is three URL-safe Base64 segments joined by dots:
header.payload.signature. Decode the first two right here to inspect a
token's claims - No library needed. (The signature only verifies with the key.)
Data URIs
data:image/png;base64,iVBOR… embeds an image directly in HTML or CSS -
no extra request. Great for tiny icons; wasteful past a few KB because of the
33% size overhead.
Email attachments
SMTP was built for 7-bit text, so every attachment you've ever sent traveled as MIME Base64 - Wrapped at 76 characters per line, which is why decoding pasted email source sometimes needs whitespace stripped first.
Basic auth & API keys
The HTTP Authorization: Basic header is just
user:password Base64-encoded - A favorite exam question because it looks
encrypted and isn't. Anyone sniffing plain HTTP reads it instantly.
What Base64 Is (and Isn't)
Encoding, not encryption
Base64 turns binary data into 64 safe ASCII characters so it can travel through text-only channels - Email attachments, JSON payloads, data URIs, JWT segments. Anyone can decode it instantly; it hides nothing.
If you need confidentiality, use real encryption like AES-256 (here's how AES-256 actually works). If you need integrity fingerprints, use SHA-256 hashes. And never "protect" a password by Base64-encoding it - Generate a proper one with the password generator.
Details that bite
- Standard Base64 uses
+and/, which break URLs - The URL-safe variant swaps in-and_(used by JWTs). - Base64 grows data by ~33%.
- This tool is UTF-8 aware, so emoji and accented characters round-trip correctly.
- Padding
=is optional in many decoders but required by strict ones.
How to Use the Base64 Encoder / Decoder
Choose encode or decode
The labels flip automatically so you always know which direction you're converting.
Toggle URL-safe when needed
JWTs, query strings and filenames need - and _ instead of + and /.
Copy the result
Decoding is UTF-8 aware, so emoji and accented text round-trip exactly.
Base64 variants
| Variant | Characters 62–63 | Padding | Where you see it |
|---|---|---|---|
| Standard (RFC 4648) | + / | = required | Email attachments, data URIs, certificates |
| URL-safe | - _ | usually stripped | JWT tokens, URL parameters, filenames |
| MIME | + / with line breaks | = required | Email bodies (76-char lines) |
Base64 Encoder / Decoder - FAQ
Is Base64 encryption?
Why does Base64 make data bigger?
Why do I sometimes see Base64 without = at the end?
Can I decode a JWT with this tool?
Does Base64 compress data?
More questions about passwords and security? Browse the security guides.
More Free Tools
Password Generator →AES-256 Encryption
Encrypt and decrypt text with AES-256, right in your browser.
MD5 Hash Generator
Compute MD5 checksums of any text instantly.
SHA-256 Hash Generator
SHA-256, SHA-384 and SHA-512 hashes computed locally.
UUID Generator
Random version-4 UUIDs, one or in bulk.
Case Converter
UPPER, lower, Title, camelCase and more.
Bcrypt Hash Generator
Hash and verify passwords with bcrypt - The slow hash built for passwords.