Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to readable text in real-time. Supports URL-safe mode, UTF-8, and file uploads — all processing happens in your browser.
Enter text to encode
Or click Sample to try with example data
Free & open tool — no signup required. Your data never leaves your browser.
What Is Base64 Encoding?
Base64 is a group of binary-to-text encoding schemes that represent binary data as a string of printable ASCII characters. It uses a set of 64 characters — A-Z, a-z, 0-9, and two symbols (+ and / in standard, or - and _ in URL-safe variant) — to encode any binary data into text form. The encoding is widely used in web development for embedding images, transmitting data in JSON/XML, encoding email attachments (MIME), and storing complex data in URLs or cookies.
How Base64 Encoding Works
- 1Input bytes are grouped into blocks of 3 bytes (24 bits). If the input length isn't divisible by 3, it's padded with zeros.
- 2Each 24-bit block is split into four 6-bit values (0-63), each mapped to a character in the Base64 alphabet.
- 3Padding characters (=) are added at the end if the original input wasn't evenly divisible by 3. One = means 1 byte of padding, == means 2 bytes.
When to Use Base64
Data URIs
Embed small images, fonts, or files directly in HTML or CSS using data:image/png;base64,... syntax.
API payloads
Safely transmit binary data (files, images, certificates) within JSON or XML payloads.
Email attachments
MIME encoding uses Base64 to encode email attachments for safe transport over text-only protocols.
Authentication tokens
JWTs and HTTP Basic Auth use Base64 (or URL-safe variant) to encode header and payload data.
Configuration files
Store binary secrets, certificates, or keys in text-based configuration formats like YAML or .env files.