Base64 Converter

Encode UTF-8 text strings into RFC 4648 Base64 ASCII payloads or decode Base64 strings back to human-readable text locally in your browser with full Unicode and multi-byte emoji safety.

Ready for local UTF-8 Base64 conversion.

How RFC 4648 Base64 Binary-to-Text Encoding Works

Base64 is a group of binary-to-text encoding schemes defined in IETF RFC 4648 that represent binary byte sequences in an ASCII string format by translating every 3 bytes (24 bits) of input data into 4 printable radix-64 characters (6 bits per character). Because Base64 restricts output to 64 safe ASCII characters (A-Z, a-z, 0-9, +, and /, with = used for padding), binary payloads can safely traverse text-only protocols such as SMTP email (MIME), HTML Data URIs, JSON payloads, and HTTP Basic Authentication headers without corruption.

Solving the JavaScript Unicode "InvalidCharacterError" Problem

Browser-native window.btoa() and window.atob() functions were originally designed exclusively for single-byte Latin1 (ISO-8859-1) strings and throw a DOMException: InvalidCharacterError whenever multi-byte UTF-8 characters (such as Devanagari, CJK scripts, accented European letters, or emojis) are passed. MaxConverter solves this by piping input through TextEncoder and TextDecoder byte arrays prior to radix-64 transformation, ensuring 100% lossless Unicode compatibility.

Base64 Size Overhead & Padding Rules

Input Byte Remainder Bits Encoded Base64 Chars Produced Trailing Padding (=)
Exact multiple of 3 bytes 24 bits 4 characters None
2 bytes remaining 16 bits (padded to 18) 3 characters + 1 pad =
1 byte remaining 8 bits (padded to 12) 2 characters + 2 pads ==