Base64 to Binary Converter
Convert Base64 encoded strings to binary representation instantly. Supports standard and URL-safe Base64 with grouped octets, raw binary stream, and file download.
About
Base64 encoding inflates data by approximately 33% - every 3 bytes of source data become 4 ASCII characters. Reversing this to raw binary exposes the actual bit-level structure: authentication tokens, cryptographic hashes, embedded images, serialized protocol buffers. Misinterpreting padding (= characters) or confusing standard Base64 (RFC 4648 ยง4) with URL-safe Base64 (RFC 4648 ยง5, using - and _ instead of + and /) corrupts output silently. This tool decodes any valid Base64 input into its binary octet representation, displays conversion statistics, and flags malformed input before damage propagates downstream.
Limitations: this tool operates on UTF-8 compatible byte streams. Binary output represents raw decoded bytes, not the original file structure. For multi-byte Unicode characters encoded via Base64, each decoded byte is rendered as an independent 8-bit group. Maximum input size is 5MB of Base64 text to prevent browser memory issues.
Formulas
Each Base64 character maps to a 6-bit value. Four Base64 characters encode exactly 3 bytes (24 bits) of binary data:
where Nchars = number of non-padding Base64 characters. Each decoded byte b is converted to binary via:
The total bit count of decoded data:
Base64 encoding overhead ratio:
where Nb64 = total Base64 string length (including padding), and Bbytes = decoded byte count. Padding characters (=) compensate when source byte count is not divisible by 3: 1 remaining byte produces 2 Base64 chars + 2 pads; 2 remaining bytes produce 3 chars + 1 pad.
Reference Data
| Base64 Character | Index (Decimal) | Binary Value (6-bit) |
|---|---|---|
| A | 0 | 000000 |
| B | 1 | 000001 |
| C | 2 | 000010 |
| M | 12 | 001100 |
| Z | 25 | 011001 |
| a | 26 | 011010 |
| m | 38 | 100110 |
| z | 51 | 110011 |
| 0 | 52 | 110100 |
| 9 | 61 | 111101 |
| + | 62 | 111110 |
| / | 63 | 111111 |
| = (pad) | - | Padding indicator |
| - (URL-safe) | 62 | 111110 |
| _ (URL-safe) | 63 | 111111 |