Base64 Encoder
Turn text or small files into Base64 for data URIs, APIs, or safe transport—preview and copy in one click.
File Upload
About Base64 Encoding
What is Base64?
Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format.
Common Uses
- • Embedding images in HTML/CSS
- • Storing binary data in JSON
- • Email attachments
- • API data transmission
Encode text, files, and binary data to Base64 format for safe transmission in JSON, HTML, APIs, and email. Base64 encoding converts binary data into ASCII characters, making it suitable for text-based protocols and storage systems. Our tool supports both text input and file uploads, with real-time encoding and copy functionality.
What is Base64 Encoder?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses 64 characters (A-Z, a-z, 0-9, +, /) to encode data, with '=' used for padding. Base64 encoding increases the size of data by approximately 33%, but ensures compatibility with systems that only handle text data.
Common Use Cases
- Embedding images in HTML or CSS using data URIs
- Storing binary data in JSON APIs where raw binary isn't supported
- Email attachments encoded in MIME format
- Data URLs for inline resources in web pages
- API payloads that need to include binary data
- Storing encrypted data in text-based databases
- Encoding credentials or tokens for HTTP Basic Authentication
How It Works
The Base64 encoder takes your input (text or file) and converts each byte into a 6-bit value, which is then mapped to one of 64 ASCII characters. The encoding process groups input bytes into 24-bit chunks, splits them into four 6-bit values, and maps each to a Base64 character. If the input length isn't divisible by 3, padding characters ('=') are added to complete the encoding.
Examples
Encoding simple text
Hello, World!SGVsbG8sIFdvcmxkIQ==Encoding a JSON-friendly string
user@example.comdXNlckBleGFtcGxlLmNvbQ==Related tools
Try these tools that work well with this one
Base64 Decoder
Convert Base64 back to original text and files
URL Encoder
Free online URL encoder tool for encoding special characters
API Tester
Send HTTP requests and view responses
CSV to JSON Converter
Convert CSV data to JSON
CSV to XML Converter
Convert CSV text to XML
Hash Generator
Generate MD5, SHA1, SHA256, SHA512 hashes
Related guides
Tutorials and guides to get more from this tool
Base64 Encoding: What It Is and How It Works
Master Base64 encoding in 5 minutes! Learn when to use it, how it works, and avoid common mistakes. Essential for API developers in 2025.
CSV ↔ XML: Converting Data Between Table and Tree
Convert CSV to XML and XML to CSV reliably. Understand headers, quoting, and escaping to preserve data integrity across formats.
5 Essential Browser Tools Every Frontend Developer Needs
Boost your productivity with these 5 indispensable in-browser tools. From debugging complex APIs to perfecting CSS colors.
ThenCatch is a free developer toolkit. Learn more about us.