Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text. Supports full UTF-8 characters including emoji and CJK text.
How to Use the Base64 Encoder/Decoder
This tool lets you convert text to and from Base64 encoding with a single click. To encode, type or paste plain text into the input area and click the "Encode" button. The Base64-encoded result will appear in the output area. To decode, paste a Base64-encoded string into the input area and click "Decode" to get the original plain text back. Use the "Copy" button to copy the output to your clipboard, or "Clear" to reset both fields.
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as a string of printable ASCII characters. It works by taking every 3 bytes (24 bits) of input and splitting them into 4 groups of 6 bits, each mapped to one of 64 characters: A–Z, a–z, 0–9, plus sign (+), and forward slash (/). If the input length isn't a multiple of 3, the output is padded with one or two equal signs (=). The resulting encoded string is approximately 33% larger than the original data, which is the trade-off for guaranteed safe transmission through text-only channels.
UTF-8 Support
The native JavaScript btoa() function only handles Latin-1 characters (code points 0–255). This tool solves that limitation by first encoding Unicode text to UTF-8 bytes using the TextEncoder API before converting to Base64, and reversing the process when decoding. This means you can safely encode and decode text in any language — including Chinese, Japanese, Korean, Arabic, emoji, and other multi-byte Unicode characters — without encountering errors.
Common Use Cases
Base64 encoding is used extensively in web development and software engineering. Email attachments are encoded in Base64 via the MIME standard so binary files can travel through text-based email protocols. Data URIs embed small images and fonts directly into HTML or CSS as Base64 strings, eliminating extra HTTP requests. API authentication headers (such as HTTP Basic Auth) encode credentials in Base64. JWT (JSON Web Tokens) use a URL-safe variant called Base64URL for their header and payload segments. Developers also use Base64 to safely embed binary data in JSON payloads, XML documents, and configuration files that only accept text content.
Base64 Is Not Encryption
A common misconception is that Base64 provides security. It does not — Base64 is an encoding scheme, not an encryption algorithm. Anyone can decode a Base64 string without a key. Never use Base64 alone to protect sensitive data like passwords or API keys. For actual security, use proper encryption algorithms (AES, RSA) or hashing functions (SHA-256). Base64 is purely a transport encoding that ensures binary data survives text-only transmission channels intact.