Base64 Encoder
Convert text and data to Base64 format instantly
Enter text to generate Base64
Quick Examples
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It converts binary data into a set of 64 characters (A-Z, a-z, 0-9, +, /) that can be safely transmitted over text-based protocols like email, HTTP, or stored in text files.
The encoding process takes every 3 bytes (24 bits) of input data and converts them into 4 Base64 characters (6 bits each). This results in approximately 33% increase in data size, but ensures the data remains intact during transmission through systems that might not handle binary data correctly.
Base64 is widely used in web development for embedding images in CSS or HTML, encoding authentication credentials in HTTP headers, storing binary data in JSON or XML, and transmitting email attachments.
Common Use Cases for Base64 Encoding
API Authentication
Encode username:password combinations for HTTP Basic Authentication headers
Data URIs
Embed images, fonts, or other files directly in HTML, CSS, or JavaScript
Email Attachments
Encode binary file attachments for transmission via SMTP protocol
Data Serialization
Store binary data in JSON, XML, or databases that only support text
Encoding Formats Explained
Standard Base64
Uses the standard Base64 alphabet: A-Z, a-z, 0-9, +, and /. Uses = for padding.
Best for: General purpose encoding, email attachments, data URIs, JSON/XML storage
URL-Safe Base64
Replaces + with - and / with _. Removes padding = characters to make it safe for URLs.
Best for: URL parameters, file names, JWT tokens, any context where + and / cause issues
Frequently Asked Questions
Why does Base64 increase file size?
Base64 encoding increases data size by approximately 33% because it converts every 3 bytes (24 bits) into 4 Base64 characters. This overhead is the trade-off for ensuring data can be safely transmitted as text.
Can I encode files or only text?
This tool is designed for text encoding. For encoding files (images, PDFs, etc.), you would need a file upload feature that reads the binary data. However, you can paste text representations of data to encode.
When should I use URL-safe encoding?
Use URL-safe Base64 when the encoded data
will be part of a URL, file name, or any
context where + and / characters could cause issues. This includes
JWT tokens, URL parameters, and file names.
Is my data secure using this tool?
Yes! All encoding happens entirely in your browser using JavaScript. No data is sent to any server. Your input and encoded output remain completely private on your device.
What are line breaks used for?
Line breaks every 76 characters follow the MIME standard (RFC 2045) for email transmission. This ensures compatibility with older email systems. Most modern applications don't require this, but it's useful for email attachments or PEM-formatted certificates.
Is Base64 encryption?
No, Base64 is not encryption. It's an encoding scheme that makes binary data text-safe. Anyone can decode Base64 data instantly. Never use Base64 alone to protect sensitive information. Use proper encryption (AES, RSA) for security.
Base64 Character Set
Uppercase (A-Z)
Values 0-25Lowercase (a-z)
Values 26-51Numbers (0-9)
Values 52-61Special (+/)
Values 62-63Padding: The = character is used for padding when the input
length is not divisible by 3.