Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 to text
About Base64 Encoder
Convert text, files, or binary data to Base64 encoding and back. Base64 turns any data into a safe ASCII string that can be included in URLs, JSON, HTML, or anywhere that doesn't handle raw binary.
Base64 is commonly used for embedding images in CSS, sending binary data in API requests, or encoding credentials for HTTP Basic Auth. This tool handles both encoding and decoding instantly in your browser.
How to use Base64 Encoder
1
Choose whether you want to encode or decode.
2
Paste text or upload a file.
3
See the result immediately.
4
For images, get a complete data URI you can use in HTML/CSS.
5
Copy the output with one click.
Examples
Encoding text
Plain text becomes a safe ASCII string:
Input: Hello, World! Base64: SGVsbG8sIFdvcmxkIQ==
Data URI for images
Embed small images directly in HTML or CSS without separate files:
data:image/png;base64,iVBORw0KGgoAAAANSUhEU... Use in CSS: background-image: url(data:image/png;base64,...); Use in HTML: <img src="data:image/png;base64,..." />
HTTP Basic Auth
Many APIs use Base64-encoded credentials:
Username: admin Password: secret123 Encode "admin:secret123" Result: YWRtaW46c2VjcmV0MTIz Authorization header: Authorization: Basic YWRtaW46c2VjcmV0MTIz
Features
Encode text to Base64
Decode Base64 back to text
Support for file uploads
Generate data URIs for images
URL-safe Base64 variant
Handles Unicode text correctly
When to use this
- •Embedding small images directly in CSS (data URIs)
- •Encoding binary files for JSON APIs
- •Creating HTTP Basic Auth headers
- •Decoding Base64 data from API responses
- •Encoding email attachments
- •Understanding encoded data you encounter
Common questions
Related Tools
Discover more free tools to boost your productivity