Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to text. Supports Unicode UTF-8 and URL-Safe modes.
Encode plain text to Base64 or decode Base64 strings back to text. Supports UTF-8 Unicode and URL-Safe modes.
How do I use Base64 Encoder / Decoder?
Select 'Encode' or 'Decode', toggle URL-Safe mode if needed, or click 'Sample' to load a UTF-8 test string.
Paste your plain text or Base64 string into the left input editor.
Copy the converted output from the right panel or click the swap button to reverse input and output.
What features does Base64 Encoder / Decoder offer?
Base64 encoding and decoding modes
Full UTF-8 Unicode string support without character corruption
URL-safe Base64 mode (- and _ character replacements)
100% client-side private execution — zero server uploads
RFC 4648 Standard Base64 vs. Base64URL Alphabet & Byte Overhead
Base64 encodes every 3 bytes (24 bits) of binary or UTF-8 data into 4 ASCII characters (6 bits per character), increasing payload byte size by roughly 33.3%.
| Specification | 62nd & 63rd Chars | Padding (=) | Primary Protocol Use Case |
|---|---|---|---|
| RFC 4648 §4 (Standard) | + and / | Required (= or ==) | MIME email attachments, Basic Auth headers, Data URIs |
| RFC 4648 §5 (Base64URL) | - and _ | Omitted or optional | JWT tokens (RFC 7519), URL query params, filenames |
| Byte Expansion Formula | 4 × ceil(n / 3) bytes | +33.3% size overhead | 1 MB binary file encodes to ~1.33 MB Base64 text |
Frequently Asked Questions about Base64 Encoder / Decoder
Why does native JavaScript `btoa()` throw `InvalidCharacterError` on UTF-8 strings or emojis?
Browser `window.btoa()` only accepts Latin-1 (`U+0000` to `U+00FF`) single-byte characters and throws an exception on multi-byte Unicode characters. Our engine encodes strings into UTF-8 byte arrays via `TextEncoder` before Base64 conversion so emojis and CJK/Vietnamese text never fail.
Why do trailing `=` or `==` signs appear at the end of Base64 strings?
Base64 processes input in 3-byte (24-bit) blocks. When the input byte length is not divisible by 3, one `=` padding character indicates 2 remaining bytes (16 bits), and `==` indicates 1 remaining byte (8 bits).
When must I use URL-Safe Base64 (`Base64URL`) instead of standard Base64?
Standard Base64 uses `+`, `/`, and `=`, which have reserved meanings in URLs (`+` decodes as a space in query strings, `/` separates path segments). Enable URL-Safe mode to replace `+` with `-`, `/` with `_`, and strip `=` padding.
Does Base64 encoding encrypt or secure sensitive passwords?
No. Base64 is a public, keyless binary-to-text encoding scheme (RFC 4648), not encryption. Anyone can decode a Base64 string in zero milliseconds—never store plaintext secrets as Base64 without encryption.
Explore Related Developer Tools
URL Encoder / Decoder
Encode and decode URL strings with encodeURIComponent, encodeURI, and Base64URL modes.
Smart String Escaper & Unescaper (JSON, HTML, JS, SQL, Unicode)
Bidirectional escaping and unescaping tool for JSON, HTML Entities, JavaScript, SQL strings, and Unicode characters.
JWT Decoder
Decode and inspect JSON Web Tokens. View header, payload, signature, and expiration status.
Shopify Webhook HMAC Verifier (Base64)
Compute and verify Base64-encoded X-Shopify-Hmac-Sha256 webhook signatures for Shopify orders/create and GDPR webhooks in browser.
Number Base & Bitwise Converter
Convert between Binary, Octal, Decimal, Hexadecimal, and ASCII text. Compute bitwise AND, OR, XOR, NOT operations.
UUID v4 / v7 Generator
Generate cryptographically secure UUID v4, time-sorted UUID v7, UUID v1, and deterministic UUID v5 in single or bulk batches.