What Is Base64 Encoding?
Learn what Base64 encoding is, why developers use it, and how to encode or decode Base64 strings online.
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. Developers use it to safely transmit data through systems that only handle text — like JSON payloads, email attachments, and data URIs.
Why use Base64?
- Embed small images directly in HTML or CSS using data URIs
- Send binary data inside JSON or XML without corruption
- Encode credentials for HTTP Basic Authentication headers
- Store binary blobs in text-only databases or logs
How Base64 encoding works
Base64 takes every 3 bytes of input (24 bits) and splits them into 4 groups of 6 bits. Each group maps to one of 64 characters: A–Z, a–z, 0–9, plus, and slash. Padding with = is added when input length is not divisible by 3.
Example
The string "Hello World" encodes to "SGVsbG8gV29ybGQ=". You can verify this instantly using our free Base64 encoder — no data leaves your browser.
Try the Base64 Encoder →Base64 vs other encodings
Base64 is not encryption — it is encoding. Anyone can decode it. For URL-safe contexts, use URL encoding instead. For cryptographic hashing, use a hash generator. Base64 is specifically for representing binary data as ASCII text.
Try the Hash Generator →