Base64 Encode & Decode
Encode text to Base64 or decode Base64 strings instantly. Free, no signup.
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It is commonly used to embed images in HTML/CSS, transmit data in JSON or XML payloads, encode email attachments (MIME), and store binary data in text-based formats like JWT tokens.
How Base64 encoding works
- Input bytes are grouped into sets of 3 (24 bits)
- Each 24-bit group is split into four 6-bit values
- Each 6-bit value maps to one of 64 ASCII characters (A-Z, a-z, 0-9, +, /)
- If input length is not divisible by 3, padding (=) is added
Common uses for Base64
| Use Case | Example |
|---|---|
| Data URIs | Embedding images in CSS: url(data:image/png;base64,...) |
| API authentication | HTTP Basic Auth header |
| JWT tokens | Header and payload are Base64-encoded JSON |
| Email (MIME) | Attachments are Base64-encoded for transport |
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is encoding, not encryption. It does not protect data — anyone can decode a Base64 string. It is designed for data transport compatibility, not security. Never use Base64 to "hide" sensitive data like passwords or API keys.
Why does Base64 make data larger?
Base64 encodes 3 bytes of input into 4 ASCII characters, resulting in a ~33% increase in size. This overhead is the tradeoff for being able to safely transmit binary data through text-only channels.