What Is Base64 Encoding? Complete Guide
Base64 is one of the most common encoding schemes in computing. You'll encounter it in API authentication, email attachments, data URIs, and JWT tokens. This guide explains what Base64 is, why it exists, and how to encode and decode it.
What Is Base64?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 characters: A-Z, a-z, 0-9, plus + and / (with = used for padding). The result is safe to transmit through systems that only handle text.
Why Base64 Is Used
- Email attachments — SMTP only supports text, so binary files are Base64-encoded
- Data URIs — embed images directly in HTML/CSS as Base64 strings
- API authentication — HTTP Basic Auth encodes credentials in Base64
- JWT tokens — header and payload are Base64URL-encoded
- Storing binary in JSON — JSON can't hold raw binary, so Base64 represents it as text
How Base64 Encoding Works
Base64 takes every 3 bytes (24 bits) of input and splits them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 printable ASCII characters. If input length isn't divisible by 3, padding characters (=) are added.
Text: "Hello"
Base64: "SGVsbG8="Base64 vs Base64URL
Base64URL is a URL-safe variant used in JWTs and web contexts. It replaces + with - and / with _, and often omits padding. Standard Base64 uses + and / which can break URLs.
Encode and Decode Base64 Online
Our free Base64 Encoder handles both encoding and decoding with full UTF-8 support — including emoji and international characters. Everything runs in your browser.
Base64 Encode & Decode Free
Instantly encode text to Base64 or decode Base64 strings — private and browser-based.
Related Free Tools
Frequently Asked Questions
Is Base64 encryption?+
No. Base64 is encoding — a reversible transformation to represent binary as text. Encryption requires a key and is designed to be hard to reverse without it.
Why does Base64 increase data size?+
Base64 encodes 3 bytes into 4 characters, increasing size by roughly 33%. This trade-off buys compatibility with text-only systems.
What does the = at the end mean?+
The = characters are padding. They indicate the original data length wasn't a multiple of 3 bytes.