What Is Base64 to Binary Conversion?
Base64 to binary conversion decodes a Base64 string into its raw bit pattern — the sequence of 1s and 0s that make up the underlying bytes — rather than into readable text or an image. It's mainly used for learning how the encoding works, debugging byte-level issues, or comparing output against a spec. This is a different tool from the Base64 file decoder, which reconstructs a downloadable file instead of showing the bit pattern.
For the conceptual comparison between the two encodings — size overhead, character sets, when to use which — see Base64 vs Binary.
How Does the Conversion Work?
Base64 → Binary: the tool decodes the Base64 string to raw bytes with atob(), then converts each byte to an 8-bit binary string with leading zeros preserved, space-separated for readability.
Binary → Base64: the tool reads the input as space- or line-separated 8-bit groups, converts each group back to a byte, and re-encodes the byte sequence with btoa().
// Base64 -> binary
const bytes = atob(b64Str);
const bits = [...bytes].map(c => c.charCodeAt(0).toString(2).padStart(8, '0')).join(' ');
// Binary -> Base64
const bytes2 = bits.split(/\s+/).map(b => String.fromCharCode(parseInt(b, 2))).join('');
const b64 = btoa(bytes2);
Example
| Input | Base64 | Binary (per byte) |
|---|---|---|
| "Hi" | SGk= | 01001000 01101001 |
Is This Converter Private?
Yes. All conversion runs locally using atob()/btoa() and basic string operations — nothing is uploaded to a server.
Frequently Asked Questions
What does Base64 look like in binary?
Each character in a Base64 string represents 6 bits of the original data. Decoding to binary shows the underlying bytes in standard 8-bit groups, not the 6-bit Base64 index values.
Is Base64 more efficient than raw binary?
No — Base64 is about 33% larger than the raw binary it represents, since it trades compactness for the ability to travel safely through text-only systems. See Base64 vs Binary for the full comparison.
Can I convert a binary file directly, not just a bit string?
For encoding an actual binary file to Base64, use the file encoder. This page is specifically for viewing/converting the 1s-and-0s bit representation.