Base64 Encoder / Decoder
Encode plain text, binary data, and Unicode strings into Base64 format — or decode Base64 back to readable text — with full UTF-8 support, live mode switching, and instant clipboard copying. Base64 encoding is fundamental in modern web development for embedding images in CSS data URIs, transmitting binary attachments through JSON APIs, encoding email MIME content, and preparing data for URL-safe transport. Our tool handles the complete UTF-8 character set including emoji, CJK characters, and accented Latin glyphs that cause errors in simpler Base64 tools. Switch instantly between encode and decode modes, process multi-line input, and copy results with a single click. Everything runs in your browser using native JavaScript btoa/atob functions with UTF-8 polyfill, so sensitive data like API tokens and encoded credentials are never transmitted externally.
Loading Base64 Encoder / Decoder...
Base64 Radix-64 Encoding Algorithm & RFC 4648 Specification
Mathematical derivation, technical breakdown & worked practical example
Base64 is a binary-to-text encoding scheme that translates arbitrary byte sequences into an ASCII subset consisting of 64 characters: A–Z (26), a–z (26), 0–9 (10), and + and /. Every 3 raw 8-bit bytes (24 bits) are divided into four 6-bit units (each representing a decimal index from 0 to 63). If input bytes are not divisible by 3, padding equal signs (=) are appended to preserve 4-character block alignment.
Worked Example: Encoding the ASCII String "Dev"
Converting the 3-byte string "Dev" into its Base64 character representation.
- Step 1: Get ASCII decimal codes: D=68, e=101, v=118
- Step 2: Convert to 8-bit binary: 01000100 01100101 01110110 (24 bits)
- Step 3: Split into 4 chunks of 6 bits: 010001 (17) | 000110 (6) | 010101 (21) | 110110 (54)
- Step 4: Look up RFC 4648 table: 17="R", 6="G", 21="V", 54="2"
- Base64 is an encoding format, NOT encryption — anyone can decode it instantly without a key.
- Ideal for embedding small icons into CSS/HTML data URIs to eliminate additional HTTP requests.
How to use Base64 Encoder / Decoder
- 1 Select Encode or Decode tab.
- 2 Paste your input text or Base64 string.
- 3 Click "Encode" or "Decode".
- 4 Copy the converted result.
Key Features of Base64 Encoder / Decoder
Full UTF-8 Unicode Support
Handles non-ASCII characters, emojis, and international alphabets accurately.
Two-Way Conversion
Instantly toggle between encoding and decoding tabs.
When to Use Base64 Encoder / Decoder
API Authentication
Encode API keys and credentials into Base64 for HTTP Basic Authentication headers or token-based authentication systems.
Embedded Images
Convert small icons, logos, and SVGs to Base64 data URIs for embedding directly in HTML, CSS, or email templates.
Data Transfer
Encode binary data as Base64 text for safe transmission through text-only channels like JSON APIs or email.
Base64 Encoding Explained: How It Works, Why 33% Overhead, and When to Use It
A developer reference explaining the Base64 encoding algorithm, why it increases data size by exactly 33%, common use cases in web development, and security misconceptions.
Zero-Knowledge Developer Privacy Guarantee
Client V8 SandboxSyntax parsing, JSON formatting, JWT token inspection, Base64 conversion, and Regex pattern matching execute entirely within your browser local JavaScript engine. Sensitive API tokens, credentials, and code payloads are never transmitted across any network.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format.
When would I use Base64 encoding?
Common uses include embedding images in HTML/CSS as data URIs, encoding credentials in HTTP Basic Authentication headers, transmitting binary data through text-based protocols like JSON or XML, and encoding email attachments.
Does Base64 provide encryption or security?
No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string. Never use Base64 as a security measure for sensitive data.
Does Base64 encoding encrypt my data?
No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 text. Never use Base64 alone to protect sensitive information.
Why does Base64 increase file size?
Base64 represents 3 bytes of binary data as 4 ASCII characters, resulting in approximately 33% size increase for safe text-based transmission.
Pro Tips & Best Practices
Data URIs for Web Dev
Encode small images under 10KB as Base64 data URIs to embed directly in HTML/CSS, eliminating extra HTTP requests for faster page loads.
Decode Auth Headers
HTTP Basic Auth headers use Base64-encoded "username:password" strings. Decode them to quickly inspect credentials during debugging.
URL-Safe Base64
Standard Base64 uses + and / which can break URLs. Use URL-safe Base64 (replacing + with - and / with _) for query parameters.
Technical Specifications & Compatibility
Engineered & Audited by Dhaval Joshi
Formatters and converters verified against official IETF RFC open specifications.
Was this Base64 Encoder / Decoder helpful?
Your feedback directly shapes our ongoing algorithmic enhancements.