Base64 Encoder/Decoder
Encode and decode Base64 strings
Upload text or binary files up to 5 MB. Text is encoded as UTF-8.
Processed on this device. Your text is not uploaded.
Usage tips
- Base64 represents binary data as text. It does not encrypt your data.
- Use file upload to encode images and other binary files, or load a text file.
- Copy the result or download it as encoded.txt or decoded.txt.
- All encoding and decoding happens locally on your device.
About Base64 Encoder & Decoder
Our Base64 encoder and decoder is a free online tool that converts text to Base64 encoding and decodes Base64 strings back to plain text instantly. Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 ASCII characters, making it safe to transmit over text-based protocols like HTTP, SMTP, and JSON.
The Base64 encoding process works by taking groups of three bytes (24 bits) and splitting them into four 6-bit values, each mapped to a printable ASCII character from A-Z, a-z, 0-9, +, and /. This makes it an essential tool for web developers who need to embed images in CSS, encode API authentication tokens, or safely transmit binary data through text-only channels.
This tool supports full Unicode text encoding, automatically handles data URI prefixes during decoding, and strips whitespace for cleaner results. Use it to build an HTTP Basic Authorization header, inline a small icon as a data URI, or read an encoded token copied from a log, with results as you type.
Key Features
- Instant real-time Base64 encoding and decoding as you type
- Full Unicode and UTF-8 character support for international text
- Automatic data URI prefix detection and stripping during decode
- File upload support for encoding text files directly
- One-click copy to clipboard for quick workflow integration
- Download encoded or decoded output as a text file
- Real-time character count for both input and output
- Clean toggle between Encode and Decode modes
- Whitespace-tolerant decoding for pasted multi-line Base64
- Dark and light mode support for comfortable use
How to Use the Base64 Tool
- Select your mode: Click "Encode" to convert plain text to Base64, or click "Decode" to convert a Base64 string back to readable text.
- Enter your input: Type or paste your text into the input area on the left. You can also click "Upload File" to load a text file from your device when in Encode mode.
- View instant results: The converted output appears automatically in the output panel on the right as you type, with no need to press a button.
- Copy the output: Click the "Copy" button above the output to copy the result to your clipboard for use in your code, API calls, or configurations.
- Download if needed: Click "Download" to save the output as a .txt file. Encoded output saves as "encoded.txt" and decoded output saves as "decoded.txt".
Use Cases
- Data URI Embedding: Encode images, fonts, and SVGs as Base64 data URIs for inline embedding in HTML and CSS without external file requests.
- API Authentication: Encode username and password pairs for HTTP Basic Authentication headers used in REST API calls.
- Email Attachments: Encode binary attachments for MIME-encoded emails transmitted over SMTP text protocols.
- JWT Token Inspection: Decode the payload section of JSON Web Tokens to inspect claims and expiration data during development.
- Cookie Storage: Encode complex data structures for safe storage in browser cookies that only support ASCII text characters.
- Configuration Files: Encode secrets and binary data for inclusion in YAML, JSON, or XML configuration files used by cloud platforms.
- Debugging Encoded Data: Decode Base64 strings found in logs, API responses, and database records to inspect their original content.
Frequently Asked Questions
Is Base64 encryption?
No, Base64 is an encoding scheme, not encryption. It transforms data into a different representation but does not provide any security. Anyone with the Base64 string can decode it. For security, use proper encryption algorithms.
Why does Base64 increase file size?
Base64 encoding increases data size by approximately 33% because it represents every 3 bytes of input as 4 ASCII characters. This trade-off is acceptable when you need text-safe transmission of binary data.
Can I encode binary files like images?
This tool is designed for text-to-Base64 encoding. For encoding binary files like images, you would need a tool that reads the file as binary data. However, you can use this tool to decode Base64-encoded image strings to verify their content.
What characters are used in Base64?
Standard Base64 uses 64 characters: uppercase A-Z, lowercase a-z, digits 0-9, plus (+), and forward slash (/). Padding is done with the equals sign (=). URL-safe Base64 replaces + and / with - and _ respectively.
Tips & Best Practices
- Check for data URI prefixes: When decoding, the tool automatically strips "data:...;base64," prefixes, so you can paste complete data URIs directly.
- Use for small assets only: While Base64 embedding eliminates HTTP requests, the 33% size increase means it is best for small images and icons, not large files.
- Verify decoded output: After decoding, always verify that the output matches your expected text, especially when dealing with multi-byte Unicode characters.
- Handle line breaks: Some systems insert line breaks in Base64 output. This tool handles them gracefully during decoding by stripping all whitespace automatically.
- Test API credentials: Use the encoder to create Base64-encoded credentials for HTTP Basic Auth headers in the format "username:password".