Base64 Converter
Encode and decode Base64 strings instantly. Convert text, images, and files to Base64 format with full UTF-8 support.
Text Input
0 characters
Base64 Output
About 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, storing images in databases, and transferring data over media that are designed to deal with textual data.
Base64 is a binary-to-text encoding scheme that represents binary data in ASCII string format. It's commonly used to embed image data in HTML, CSS, or JSON, transmit binary data through text-only protocols, and encode file contents for data URIs. Our converter handles text encoding with full UTF-8 support, including Chinese, Japanese, and other Unicode characters.
When to Use This Tool
- Embedding images directly in HTML/CSS (data URIs) to reduce HTTP requests
- Transmitting binary data through JSON APIs that only support text
- Encoding email attachments (MIME format uses Base64)
- Storing binary data in XML or JSON configuration files
- URL-safe encoding for URL parameters
- Basic authentication credentials encoding
- Preparing images for CSS sprites or inline SVG
How to Use
Encode Text to Base64
- Enter or paste your text in the input area
- Click 'Encode' to convert to Base64
- Copy the Base64 result for use in your project
- Use the 'Copy' button for one-click clipboard copy
Decode Base64 to Text
- Paste Base64-encoded text in the input area
- Click 'Decode' to convert back to plain text
- Verify the decoded result is correct
- Fix any encoding issues if the result shows garbled characters
Encode Images to Base64
- Click the file upload button or drag and drop an image
- The image will be automatically converted to Base64
- Copy the data URI for use in img tags or CSS
- Example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...
Examples
Simple Text Encoding
ASCII text 'Hello, World!' encoded to Base64
Input
Hello, World!
Result
SGVsbG8sIFdvcmxkIQ==
Chinese Characters (UTF-8)
UTF-8 encoded Chinese characters properly handled
Input
你好,世界!
Result
5L2g5aW9IOS4reSfriE=
URL-Safe Base64
Note: + becomes -, / becomes _, and trailing = may be removed for URL safety
Input
Hello+World/Base64==
Result
SGVsbG8rV29ybGQvQmFzZTY0PT0=
Frequently Asked Questions
Is Base64 encryption? Is my data safe?
Base64 is NOT encryption - it's encoding. Anyone can decode Base64 back to original data. It's like writing in alphabet soup - visible to everyone. Never use Base64 to hide sensitive information. Use proper encryption (AES, RSA) for security.
Why does my decoded text show garbled characters?
This usually means the original text wasn't UTF-8 encoded. If you're decoding data from an external source, check what character encoding they used. Common encodings: UTF-8, ISO-8859-1 (Latin-1), Windows-1252. The encoding must match between encode and decode operations.
What's the size increase when using Base64?
Base64 increases size by approximately 33%. Every 3 bytes of binary data become 4 Base64 characters. Plus, the output may include padding (=) characters. A 1MB image becomes about 1.37MB when Base64 encoded.
When should I use URL-safe Base64?
Use URL-safe Base64 (using - and _ instead of + and /) when encoding data that will be used in URLs, URL parameters, or file names. Standard Base64 can contain characters that need URL encoding, while URL-safe Base64 is designed to be directly URL-friendly.
Can I use Base64 for images in production?
Base64 images are useful for small icons and critical resources to reduce HTTP requests. However, for larger images, Base64 increases page size and can't be cached separately. Consider using it strategically for above-the-fold content or critical UI elements only.
Pro Tips
- •Data URIs for images: data:image/[type];base64,[encoded_data]
- •Use URL-safe Base64 (- and _) for URL parameters instead of standard Base64
- •For binary data integrity, use Base64 in APIs that don't support binary transmission
- •Base64 is reversible - never encode sensitive data expecting it to be hidden
- •When working with APIs, check if they require padding (=) characters or not
- •Large Base64 strings can impact performance - consider compression for very large data
- •Some systems truncate long Base64 strings - split into chunks if needed