Base64 Encode/Decode
Base64 Encoder & Decoder — Encode and Decode Base64 Online Free
What is Base64 Encode/Decode?
Encode text to Base64 or decode Base64 strings back to plain text. Supports full UTF-8 encoding for multi-byte characters.
Base64 is a binary-to-text encoding scheme that converts binary data into a string of printable ASCII characters. It uses a 64-character alphabet (A-Z, a-z, 0-9, +, /) plus = for padding. Base64 encoding is essential in web development for embedding binary data in text-based formats like HTML, CSS, JSON, and email. Common use cases include data URIs for inline images, MIME encoding for email attachments, encoding binary API payloads, and debugging JWT tokens. Our encoder handles full UTF-8 text by first converting multi-byte characters to their byte representation before encoding. The decoder reverses this process, properly handling UTF-8 byte sequences. Base64 encoding increases data size by approximately 33%, which is the trade-off for transport safety. Remember that Base64 is not encryption — it is a reversible encoding scheme that provides no security.
How to Use Base64 Encode/Decode
- Paste or type your input into the editor on the left panel.
- Results update automatically while you type. You can also press Ctrl+Enter to force a refresh.
- View the result in the output panel on the right with full syntax highlighting.
- Use Copy or Download to export the result.
- Drag and drop
.jsonor.txtfiles directly into the editor.
Example
Input:
Hello, World! This is a test string for Base64 encoding.
Output:
SGVsbG8sIFdvcmxkISBUaGlzIGlzIGEgdGVzdCBzdHJpbmcgZm9yIEJhc2U2NCBlbmNvZGluZy4=
Common Use Cases
- Encoding images or files for embedding in HTML data URIs
- Encoding binary attachments for email (MIME) transport
- Creating Base64-encoded API authentication tokens
- Encoding data for safe inclusion in JSON strings
- Debugging encoded values in JWT tokens, cookies, and API headers
Base64 vs Plain Text
Common Errors
- Base64 is encoding, not encryption — do not use it to protect sensitive data
- Invalid Base64 strings cause decode errors — ensure the input has valid characters and correct padding
- Line breaks in Base64 strings may cause issues — remove them before decoding
- Non-ASCII characters require UTF-8 encoding before Base64 encoding
- Missing padding characters (=) at the end may produce incorrect decode results
Why Use Our Base64 Encode/Decode?
- 100% client-side — your data never leaves your browser. No server processing, no data collection.
- No sign-up required — start using the tool instantly with no registration or installation.
- Keyboard shortcuts — press Ctrl+Enter to run, ? for shortcuts list, Ctrl+B to toggle sidebar.
- Persistent state — your input is automatically saved across sessions using local storage.
- IDE-style interface — Monaco Editor (the engine behind VS Code) with syntax highlighting and error detection.
- Multi-format conversion — convert between JSON, XML, CSV, and YAML without switching tools.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as printable ASCII characters using a 64-character alphabet. It is commonly used in emails, data URIs, API tokens, and JWT.
How do I switch between encode and decode mode?
Use the mode toggle (Encode/Decode) above the editor. In Encode mode, your input is plain text and the output is Base64. In Decode mode, the input is Base64 and the output is plain text.
Does this tool support UTF-8 characters?
Yes. The tool uses the TextEncoder and TextDecoder APIs to properly handle multi-byte UTF-8 characters including emojis, Chinese characters, Arabic text, and other Unicode content.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without any key. Never use Base64 to protect sensitive data — use proper encryption algorithms like AES instead.
Why does Base64 make the data larger?
Base64 encoding represents every 3 bytes of input as 4 ASCII characters, resulting in approximately 33% size increase. This is the trade-off for making binary data safe to transmit through text-based protocols.
Try Base64 Encode/Decode Now
Paste your data into the editor above for instant processing. Use Ctrl+Enter anytime to re-run quickly.