Base64 Encoder & Decoder
Free online Base64 encoder and decoder. Encode text to Base64 or decode Base64 to text instantly. Supports Base64URL, batch processing, and Unicode. 100% browser-based, no data upload.
How to Use Base64 Encoder & Decoder
Enter Your Text
Type or paste the text you want to encode in the input box. The tool supports all Unicode characters including Chinese, Japanese, and special symbols.
Choose Your Mode
Click "Encode" to convert plain text to Base64, or "Decode" to convert Base64 back to readable text. The result appears instantly in real-time.
Copy the Result
Click the copy button in the output area to copy the result to your clipboard. A confirmation will appear when the copy is successful.
Swap if Needed
Use the "Swap" button to quickly swap the input and output values, automatically switching between encode and decode modes.
Tips for Best Results
- Valid Base64 strings - When decoding, ensure your input is a valid Base64 string (only contains A-Z, a-z, 0-9, +, /, and = for padding)
- Use Base64URL for URLs - Select "Base64URL (URL Safe)" format when encoding data for use in URLs or JWT tokens. It replaces + and / with - and _
- Batch mode for multiple lines - Enable "Batch Mode" to process multiple lines separately. Each line will be encoded/decoded independently
- Unicode support - Our tool fully supports UTF-8 encoding, so Chinese, Japanese, and emoji characters work perfectly
- Swap quickly - Use the Swap button to instantly reverse the operation. Great for verifying your encoding/decoding
- No size limits - Process as much text as you need without any restrictions
- Privacy first - All processing happens in your browser. Your data never leaves your device
Frequently Asked Questions
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, and /) to represent data in a format that can be safely transmitted over text-based protocols like email or HTTP. The "=" character is used for padding when the input length is not a multiple of 3 bytes.
No, Base64 is encoding, not encryption. It does not provide any security or confidentiality. Anyone can decode a Base64 string back to its original form. If you need to protect sensitive data, you should use proper encryption methods like AES instead.
Base64 encoding is commonly used for:
- Email attachments - MIME protocol uses Base64 to send binary files via email
- API authentication - HTTP Basic Auth encodes credentials in Base64
- JWT tokens - JSON Web Tokens use Base64URL encoding
- Data URLs - Embedding images and files directly in HTML/CSS
- Configuration files - Storing binary data in text-based formats like JSON or XML
Yes, absolutely! This tool runs 100% in your browser using JavaScript. No data is sent to any server. Your text is processed locally on your device, ensuring complete privacy. You can even use this tool offline once the page is loaded.
Base64URL is a URL-safe variant of Base64 encoding:
- Base64 uses
+and/characters - Base64URL replaces them with
-and_ - Base64URL also omits the
=padding characters
Our tool accepts both formats for decoding and automatically handles the conversion.
Yes! Our tool fully supports UTF-8 encoding, which means you can encode and decode text in any language including Chinese, Japanese, Korean, Arabic, Hebrew, and even emoji characters. The tool uses the modern TextEncoder/TextDecoder API for perfect Unicode support.
Batch Mode allows you to process multiple lines of text independently. When enabled, each line in the input is encoded or decoded separately, and the results are displayed on separate lines.
Use Batch Mode when you need to:
- Encode/decode a list of values at once
- Process multiple API keys or tokens
- Bulk convert a column of data
Simply check the "Batch Mode" checkbox and enter one item per line.
Yes! You can load text directly from a file:
- Click the upload button (folder icon) next to the input label
- Select any text file (.txt, .json, .csv, etc.)
- The file content will be loaded into the input area
- The tool will automatically process and show the result
This is useful for encoding/decoding configuration files, data exports, or any text files without manual copying.
How Base64 Encoding Works
Base64 encoding converts binary data into a text representation using 64 ASCII characters. This allows binary data to be safely transmitted through systems that only support text.
The 64 Characters
Base64 uses a specific set of 64 characters that are safe for text transmission:
The Encoding Process
- Convert to Binary - The input text is first converted to binary using UTF-8 encoding, where each character becomes 8 bits (1 byte)
- Group into 6-bit Chunks - The binary data is divided into groups of 6 bits (Base64 uses 6 bits because 2^6 = 64 characters)
- Map to Characters - Each 6-bit value (0-63) is mapped to its corresponding character in the Base64 alphabet
- Add Padding - If the input length is not divisible by 3, "=" characters are added to make the output length a multiple of 4
Why 64 Characters?
The number 64 is chosen because it's a power of 2 (2^6 = 64), meaning each Base64 character can represent exactly 6 bits of data. This makes the encoding efficient and deterministic. The output is always approximately 33% larger than the input because every 3 bytes of input become 4 characters of output.
About Base64 Encoder & Decoder
Free online Base64 encoder and decoder. Encode text to Base64 or decode Base64 to text instantly. Supports Base64URL, batch processing, and Unicode. 100% browser-based, no data upload.