Base64 Encoder & Decoder
Encode or decode Base64 strings instantly — free and private
Size Comparison
Quick Reference
- Encode converts text to Base64
- Decode converts Base64 back to text
- Output is ~33% larger than the input
- Full UTF-8 support for all languages
Common Use Cases
- Embedding images in CSS/HTML
- Email attachments (MIME)
- Data URIs and JSON payloads
- JWT tokens and API auth
100% Private
All encoding and decoding happens locally in your browser. No data is ever sent to any server.
What Is Base64 Encoding?
Understanding the encoding scheme that safely transports binary data through text channels
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It uses a set of 64 characters — uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), plus (+), and slash (/) — to represent data. The equals sign (=) is used for padding.
Base64 encoding works by taking every 3 bytes (24 bits) of input and splitting them into 4 groups of 6 bits each. Each 6-bit group maps to one of the 64 characters. When the input length is not a multiple of 3, padding characters are appended to complete the final 4-character block.
Email & MIME
Email protocols like SMTP only support 7-bit ASCII. Base64 encodes binary attachments (images, PDFs, archives) into safe ASCII text so they can travel through email systems without corruption.
Web Development
Data URIs use Base64 to embed images, fonts, and other assets directly in HTML, CSS, or JavaScript. This reduces HTTP requests and can improve performance for small assets.
APIs & Tokens
JSON Web Tokens (JWT), HTTP Basic Authentication, and many API payloads use Base64 encoding to embed structured data in headers and URLs without special character conflicts.
Base64 Character Set Reference
The 64 characters used in standard Base64 encoding (RFC 4648)
| Index Range | Characters | Description |
|---|---|---|
| 0 – 25 | A B C D ... X Y Z | Uppercase Latin letters |
| 26 – 51 | a b c d ... x y z | Lowercase Latin letters |
| 52 – 61 | 0 1 2 3 4 5 6 7 8 9 | Digits |
| 62 | + | Plus sign (or - in URL-safe variant) |
| 63 | / | Forward slash (or _ in URL-safe variant) |
| Pad | = | Padding character (0–2 appended to output) |
URL-safe variant: In URL-safe Base64 (Base64url), the + character is replaced with - and / is replaced with _ to avoid conflicts in URLs and filenames.
Frequently Asked Questions
Common questions about Base64 encoding and decoding
TextEncoder and TextDecoder APIs to properly handle UTF-8 multi-byte characters before encoding. This means emojis, accented characters, Chinese/Japanese/Korean text, and other non-ASCII characters are encoded and decoded correctly.