Base64 Encode/Decode
Encode text to Base64 or decode Base64 back to text.
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It represents binary data using 64 characters (AβZ, aβz, 0β9, +, and /) plus = for padding. Base64 encoding increases the data size by approximately 33%, but guarantees safe transport across systems that only handle text.
Base64 encoding is essential in web development and software engineering. It's used to embed images directly in HTML and CSS via data URIs, transmit binary data in JSON payloads and API responses, encode email attachments (MIME), store binary data in XML or text-based config files, and handle authentication tokens like HTTP Basic Auth headers.
This Base64 encoder/decoder runs entirely in your browser β your data never leaves your machine. It features auto-detection that intelligently determines whether your input needs encoding or decoding, full Unicode/UTF-8 support for international characters and emoji, and instant results as you type.
How to Encode and Decode Base64
- Paste or type your input β Enter plain text to encode or a Base64 string to decode in the input field.
- Auto-detect mode β With auto-detect enabled (default), the tool automatically determines whether to encode or decode based on your input. Valid Base64 strings are decoded; everything else is encoded.
- Manual encode/decode β Use the "Encode β" button to force Base64 encoding, or "β Decode" to force decoding. This is useful when auto-detect guesses wrong.
- Swap input and output β Click "β Swap" to move the result back into the input field, letting you verify round-trip encoding/decoding.
- Copy the result β Click "Copy" to copy the encoded or decoded output to your clipboard.
Key Features
- Auto-detection β Automatically detects whether input is Base64 or plain text and performs the appropriate conversion in real time.
- Full UTF-8 support β Correctly encodes and decodes Unicode characters, including emoji, accented characters, CJK characters, and other multi-byte sequences.
- Instant results β Encoding and decoding happen as you type with no delay, thanks to client-side processing.
- Error handling β Clear error messages when decoding fails, helping you identify malformed Base64 strings.
- Swap functionality β Quickly swap input and output to verify round-trip encoding or chain multiple operations.
- 100% client-side β Your data never leaves your browser. No server requests, no logging, no tracking.
Common Use Cases
- Embedding images in CSS/HTML β Convert small images to Base64 data URIs to reduce HTTP requests and inline assets directly in your stylesheets or markup.
- API authentication β Encode credentials for HTTP Basic Authentication headers (
Authorization: Basic base64(user:pass)). - Debugging encoded payloads β Decode Base64 strings from JWT tokens, API responses, webhook payloads, or log files to inspect the original data.
- Email attachment encoding β Base64 is the standard encoding for email attachments in MIME format. Decode to inspect or encode for manual SMTP testing.
- Storing binary in text formats β Encode binary data for safe inclusion in JSON, XML, YAML, or environment variables that don't support raw binary.
Frequently Asked Questions
π This tool runs entirely in your browser. No data is sent to any server.