Understanding Base64 Radix-64 Representation
Base64 is a binary-to-text encoding scheme that translates arbitrary binary sequences, byte strings, and UTF-8 characters into a restricted character set of 64 ASCII printable characters (A-Z, a-z, 0-9, +, and /). It is designed to safely carry data across media and protocols that were historically engineered for 7-bit ASCII transport—such as MIME email bodies, HTTP Basic Auth credentials, JSON Web Tokens (JWT), and inline data URIs.
Standard vs. URL-Safe Base64
Standard Base64 contains + and /, both of which serve as reserved separators in URL paths and query parameters. URL-safe Base64 substitutes these with hyphens (-) and underscores (_), making strings safe for REST routing and token handshakes.
The ~33% Payload Overhead
Base64 takes 3 bytes of binary data (24 bits) and maps them onto four 6-bit characters. This causes an expected 33% increase in character volume and size compared to the raw binary input.
Base64 Encoding Specifications & Applications
| Protocol / Target | Recommended Format | Padding Convention | Primary Purpose |
|---|---|---|---|
| HTTP Basic Authorization | Standard (+, /) | Requires '=' padding | Encodes username:password headers |
| JSON Web Tokens (JWT) | URL-Safe (-, _) | Strip '=' padding | Compact bearer token transmission |
| CSS & HTML Data URIs | Standard (+, /) | Preserves '=' padding | Inlines micro SVGs, fonts, and images |
| MIME Email Attachments | Standard (+, /) | Preserves '=' padding | Encodes binary attachments over SMTP |
Frequently Asked Questions
How does this tool handle international characters, special symbols, and emojis?
The encoder passes strings through the browser's native TextEncoder API to produce strict UTF-8 byte streams prior to Base64 translation. This prevents character truncation or URI malformed errors that commonly affect standard JavaScript window.btoa implementations.
What is the difference between standard Base64 and URL-safe Base64?
Standard Base64 uses '+' and '/' alongside '=' padding characters. URL-safe Base64 substitutes '+' with '-' (hyphen) and '/' with '_' (underscore), ensuring the encoded string can safely traverse query parameters without URL percent-encoding.
Is my plain text or encoded string transmitted to any server?
No. All text encoding and decoding routines execute strictly client-side inside your browser's local memory. No payload content is sent across the network or logged.