Base64 Encode/Decode
Encode text to Base64 or decode Base64 strings. Essential for data transmission, APIs, and web development.
What It Does
A Base64 Encoder/Decoder is a utility that converts text and binary data to and from Base64 encoding. Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 printable characters (A-Z, a-z, 0-9, +, /). This encoding is essential for transmitting binary data over text-based protocols like email, JSON, or URLs, where binary data might be corrupted or misinterpreted. It's widely used for embedding images in HTML/CSS, encoding authentication credentials, and safely transmitting data in APIs.
Key Features:
- Bidirectional conversion: encode text to Base64 and decode Base64 to text
- Support for UTF-8 text encoding for international characters
- URL-safe Base64 encoding variant for query parameters and paths
- File encoding support for images, documents, and binary files
- Automatic character set detection and conversion
- Copy encoded/decoded output with one click
- Real-time encoding/decoding as you type
- Display of encoded data size compared to original
How To Use
Encoding and decoding Base64 data is simple and instant. Use this tool for safely transmitting data, embedding resources, or decoding encoded strings.
Choose Encode or Decode
Select whether you want to encode plain text to Base64 or decode Base64 back to readable text. The tool supports bidirectional conversion.
Enter Your Data
For encoding: paste or type any text, including special characters and emojis. For decoding: paste the Base64 encoded string you want to convert back to plain text.
Select Encoding Options
Choose standard Base64 or URL-safe Base64 (which replaces + with - and / with _ for use in URLs). For text, ensure UTF-8 encoding for proper international character support.
View Results Instantly
The conversion happens in real-time. See the encoded/decoded output immediately in the results area, along with the size of the output data.
Copy or Use the Output
Click the copy button to copy the result to your clipboard, then paste it into your application, API, or configuration file.
Pro Tips
- •Base64 increases data size by approximately 33% - use it only when necessary
- •Use URL-safe Base64 when encoding data for URLs to avoid special character issues
- •Remember that Base64 encoding is NOT encryption - it's easily reversible
- •For binary files, encoding can result in very large strings
- •When decoding, ensure the string is valid Base64 to avoid errors
- •UTF-8 encoding is automatically handled for international characters
Benefits
Use Cases
HTTP Basic Authentication
Encode username:password combinations for HTTP Basic Auth headers in API requests.
Encode "username:password" to include in Authorization headerData URI for Images
Convert small images to Base64 for embedding directly in HTML or CSS, reducing HTTP requests.
Create data:image/png;base64,... URIs for inline imagesEmail Attachments
Encode file attachments in Base64 for transmission in MIME email messages.
Encode PDF or image files for email APIsJSON API Data Transmission
Include binary data like images or documents in JSON API payloads.
Send user profile pictures in JSON registration requestsConfiguration Files
Store binary data or credentials in text-based configuration files.
Encode API keys or certificates in YAML/JSON configsQR Code Generation
Encode data for QR codes or decode QR code data for processing.
Encode URLs or vCard data for QR code librariesCode Examples
Simple Text Encoding
Basic text to Base64 encoding example
Input: Hello World
Base64: SGVsbG8gV29ybGQ=HTTP Auth Header
Base64 encoded credentials for HTTP Basic Auth
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=Data URI Image
Embedding Base64 image in HTML
<img src="data:image/png;base64,iVBORw0KGgoAAAANS..." />Frequently Asked Questions
1 Is Base64 encoding secure or encrypted?
2 Why does Base64 make data larger?
3 What's the difference between standard and URL-safe Base64?
4 Can I encode files with Base64?
5 Why am I getting invalid Base64 errors when decoding?
Related Tools
Base64 / URL / HTML Entities
Encode and decode Base64, URL encoding, and HTML entities. All-in-one encoding tool for web development.
URL Encode/Decode
Encode and decode URLs for web development. Convert special characters to URL-safe format and back.
Text Case Converters
Convert text to uppercase, lowercase, title case, camelCase, snake_case, and more. Perfect for formatting code, titles, and content.
Timestamp Converter
Convert between Unix timestamps and human-readable dates. Support for milliseconds and multiple time zones.
Number Base Converter
Convert numbers between binary, decimal, hexadecimal, and octal. Essential tool for programming and computer science.
JSON to CSV Converter
Convert JSON arrays to clean CSV with headers and custom delimiters.