Base64 Encoder / Decoder
Encode and decode Base64 and Base64URL. Handles Unicode characters. Real-time as you type.
Standard vs URL-Safe Base64
Standard Base64 uses +, /, and = padding. URL-Safe Base64 replaces these with - and _ and removes padding — safe for URLs, cookies, and JWT tokens.
Text converted to UTF-8 bytes — any Unicode, including emoji and accented characters
Every 3 bytes (24 bits) regrouped into four 6-bit values — a 3:4 byte-to-character expansion
Each 6-bit value (0–63) maps to A–Z, a–z, 0–9, then +/ (standard) or -_ (URL-safe)
'=' appended if input isn't a multiple of 3 bytes — URL-safe Base64 typically omits padding
Safe for HTTP headers, JSON, HTML, cookies, and URL query parameters
Input validated — only A–Z, a–z, 0–9, +/, -_, and = characters are valid
'=' padding removed; string length padded to a multiple of 4 if missing
Each Base64 character converted back to its 6-bit value using the alphabet lookup table
Four 6-bit values packed back into three 8-bit bytes
Bytes interpreted as UTF-8 text — decoding fails if bytes are not valid UTF-8
Spec: RFC 4648 §4 (Base64), RFC 4648 §5 (Base64url)