What is Base64?
01 Definition
Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. It is NOT an encryption algorithm. Its primary purpose is to convert binary data (like images, audio, files) into text format for safe transmission over text-only protocols.
Note: The equals sign (=) is used only for padding.
02 How it Works
Base64 splits every 3 bytes (3 × 8 = 24 bits) of data into 4 groups (4 × 6 = 24 bits). Each 6-bit value (0-63) maps to a character in the Base64 index table.
This is why Base64 encoded data is typically 1/3 (approx 33%) larger than the original data.
03 Common Scenarios
-
Data URI Scheme Embedding small images directly in HTML/CSS (e.g.
data:image/png;base64,...) to reduce HTTP requests. -
Email Attachments (MIME) SMTP was designed for 7-bit ASCII. Base64 allows sending binary files like images and PDFs via email.
-
API Data Transfer Transmitting binary data (like avatar uploads) in text-based formats like JSON or XML.
-
Simple Obfuscation Hiding config details or text from plain sight (though insecure, it prevents casual reading).
FAQ
Is Base64 encryption?
Why does the size increase?
Why are there "=" signs at the end?
= is used for padding. If the binary data length isn't divisible by
3, padding characters are added to complete the final block of 4 characters.
Does it support UTF-8 / Unicode?
What is "URL Safe" Base64?
Is my data processed locally?
How to convert Image to Base64 in JS?
FileReader API with the readAsDataURL() method. This
is useful for previewing uploaded images.
When was it invented?
More Free Tools
URL Encoder/Decoder
Online URL Encode and Decode tool. Fix broken parameter characters. UTF-8 supported.
JSON Formatter
Pretty print, minify, and validate JSON data online with syntax highlighting.
Unix Timestamp Converter
Convert between Unix timestamps and human-readable dates. Supports seconds & milliseconds.
UUID Generator
Instant batch UUID/GUID generator (v4). Secure client-side processing for developers.
Diff Checker
Compare distinct text files to find differences. Highlight changes instantly.
Color Converter
Convert between HEX, RGB, HSL, and CMYK formats with real-time preview.