Online Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings back to text. Perfect for data transmission, API development, and web applications.
Text to Encode
Base64 Encoded
About Base64
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used for encoding data in URLs, email attachments, and data transmission.
Common Uses:
- • Email attachments (MIME)
- • Data URLs in web pages
- • API authentication (Basic Auth)
- • Storing binary data in JSON
- • URL encoding for special characters
Example:
Hello World!
SGVsbG8gV29ybGQh
Character Set:
Base64 uses 64 characters: A-Z, a-z, 0-9, +, and / (with = for padding).
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 different characters. It was originally developed for email systems to handle binary attachments, but has since become widely used in web development, APIs, and data transmission protocols.
The name "Base64" comes from the fact that it uses 64 different characters to represent data: A-Z (26 characters), a-z (26 characters), 0-9 (10 characters), plus (+) and forward slash (/) for a total of 64 characters. The equals sign (=) is used for padding when the input data doesn't divide evenly into groups of 3 bytes.
Base64 encoding works by taking every 3 bytes (24 bits) of binary data and converting them into 4 Base64 characters. Each Base64 character represents 6 bits of data, so 4 characters × 6 bits = 24 bits, which equals the original 3 bytes. This process increases the size of the data by approximately 33%.
Common Base64 Use Cases
Web Development
- • Data URLs for embedding images in HTML/CSS
- • HTTP Basic Authentication headers
- • JSON payloads containing binary data
- • Cookie values and session data
- • URL-safe encoding for query parameters
- • WebSocket message encoding
Email & Communication
- • MIME email attachments
- • SMTP protocol data transfer
- • XML document binary data
- • RSS feed image encoding
- • API response data formatting
- • Database binary field storage
Technical Details
Character Set
Base64 uses exactly 64 characters: A-Z (26), a-z (26), 0-9 (10), plus (+) and forward slash (/). The equals sign (=) is used for padding but is not part of the 64-character alphabet.
Padding Rules
When the input data length is not divisible by 3, padding is added using equals signs. One equals sign is added for 2 remaining bytes, two equals signs for 1 remaining byte.
Size Overhead
Base64 encoding increases data size by approximately 33%. For every 3 bytes of input, 4 characters of output are produced, plus any necessary padding characters.
Features
Encode & Decode
Convert text to Base64 and vice versa
Easy Mode Switching
Toggle between encode and decode modes
Copy & Download
Easy copying and downloading of results
File Upload
Upload text files for encoding/decoding
Image Support
Upload images to get Base64 data URLs
Real-time Processing
See results instantly as you type
Learn More About Base64
RFC 4648 Standard
Read the official RFC specification for Base64 encoding and decoding.
RFC 4648: The Base16, Base32, and Base64 Data Encodings →MDN Web Docs
Learn about Base64 encoding in web development and browser APIs.
MDN Base64 Documentation →Wikipedia Base64
Comprehensive information about Base64 encoding history and usage.
Wikipedia Base64 Article →