How to use this tool
Encode: type or paste text, and the Base64 version appears on the right. Tick URL-safe if the result is going into a URL, a filename or a JWT.
Decode: paste Base64 (standard or URL-safe, with or without padding, line breaks are fine) and the original text appears. If the input isn’t valid Base64, you’ll see an error rather than garbage.
Text is handled as UTF-8, so emoji and non-Latin scripts round-trip correctly — a common failure in older tools.
How Base64 works
Base64 takes data 3 bytes (24 bits) at a time and splits it into four 6-bit groups. Each 6-bit value (0–63) maps to a character in the alphabet:
A–Z → 0–25 a–z → 26–51 0–9 → 52–61 + → 62 / → 63
The word Hi! is bytes 72 105 33, which as bits regroup to 18 6 36 33, giving SGkh. When the input length isn’t a multiple of 3, the final group is padded with =.
Where you’ll meet Base64
- Data URLs —
<img src="data:image/png;base64,…">embeds an image directly in HTML or CSS. - Email attachments — MIME encodes binary attachments as Base64 text.
- HTTP Basic auth — the
Authorization: Basic …header isusername:passwordin Base64 (which is why it must only be used over HTTPS). - JWTs — the header and payload are URL-safe Base64 JSON; decode them with the JWT decoder.
- API payloads — binary fields (files, keys, certificates) in JSON are typically Base64.
- Certificates and keys — PEM files are Base64 between
-----BEGINand-----ENDlines.
Common mistakes
- Treating it as security. Base64 is trivially reversible. Use real encryption for anything sensitive.
- Forgetting the size cost. A 1 MB image becomes 1.33 MB as a data URL and can’t be cached separately.
- Mixing variants. Standard Base64 in a URL breaks on
+and/; URL-safe Base64 fed to a strict standard decoder fails on−and_. This tool accepts both. - Double encoding. Encoding already-encoded text works but is almost never what you want.
Frequently asked questions
What is Base64?
A way of representing any binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It lets binary content travel safely through systems designed for text — email, JSON, URLs, HTML attributes.
Is Base64 encryption?
No. It's an encoding, not a cipher — anyone can decode it instantly, and this tool proves it. Never use Base64 to hide passwords or secrets.
Why is the output longer than the input?
Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original. The trailing = signs are padding to make the length a multiple of 4.
What is URL-safe Base64?
A variant that swaps + for − and / for _ and drops the padding, so the result can sit in a URL or filename without further escaping. JWTs use this form.
Last updated August 26, 2026.