Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings back to plain text.
What is Base64?
Encoding scheme
Base64 converts binary data to a text string using 64 printable ASCII characters. It's standard in APIs, data URIs, and email attachments.
Common use cases
Embedding images in CSS/HTML as data URIs, passing binary data in JSON payloads, Basic Auth headers, and JWT token payloads.
Not encryption
Base64 is encoding, not encryption. It's easily reversible and provides no security. Never use it to "hide" sensitive data.
Base64 Encoding Explained — How It Works and Where It Is Used
Base64 encoding converts binary data into a string of 64 printable ASCII characters. The name comes directly from this: base 64 means each character represents 6 bits of data (2⁶ = 64). It was invented to solve a real problem — early internet protocols like email were text-only, but people needed to send binary files like images and documents. Base64 made binary data look like text.
How Base64 works
The encoder takes 3 bytes (24 bits) of input and splits them into four 6-bit groups. Each group maps to one of 64 characters: A–Z (26), a–z (26), 0–9 (10), plus two special characters (+ and /). This is why Base64 output is always 4/3 the size of the input. If the input isn't divisible by 3, padding characters (=) fill the gap.
Real-world uses today
HTTP Basic Authentication encodes username:password as Base64 in the Authorization header. JWT tokens encode their header and payload as Base64URL. CSS data URIs embed images directly in stylesheets as Base64 strings. JSON APIs use Base64 to include binary data (images, files) without needing multipart form encoding. Email attachments travel as Base64-encoded MIME parts.
Base64 is not encryption
This is the most important thing to understand: Base64 is encoding, not encryption. Decoding is instant and requires no key. Never use Base64 to "hide" passwords, API keys, or sensitive data. It provides zero security — it's purely a text-safe transport format.