Base64 to Binary Converter

Decode Base64 encoded strings into raw 8-bit binary byte sequences, instantly and entirely in your browser.

0 chars
0 chars

What is a Base64 to Binary Converter?

A Base64 to Binary Converter is a decoding tool that reverses the Base64 encoding process, transforming a Base64-encoded text string back into its underlying binary (bit-stream) representation. Base64 encodes arbitrary binary data using only 64 safe printable ASCII characters — A–Z, a–z, 0–9, +, and / — by processing three input bytes at a time and producing four output characters. Each Base64 character represents exactly 6 bits of the original data (\(2^6 = 64\)), and the decoder's job is to reverse this mapping: look up each character's 6-bit index value, concatenate those bits back into a continuous stream, and then re-interpret that stream as 8-bit bytes.

The decoding algorithm works in the reverse of encoding. First, padding characters (=) are identified and stripped to determine how many bits of actual data are present. Then each Base64 character is mapped back to its 6-bit decimal index using the Base64 alphabet table (A=0, B=1 … Z=25, a=26 … z=51, 0=52 … 9=61, +=62, /=63). These 6-bit values are concatenated into a continuous bit stream and then split into consecutive 8-bit groups to recover the original bytes. Finally, each 8-bit group is output as its binary representation. This entire process is performed in the browser using the native atob() function, ensuring maximum compatibility and speed with no server-side processing.

Base64-to-binary decoding is critical in a range of professional workflows. Security researchers decode Base64-encoded malware payloads and obfuscated shellcode to inspect the underlying binary instructions. Web developers decode inline data: URI images and fonts back to their binary form for analysis or to verify file integrity. Reverse engineers examine Base64-wrapped binary data in network captures, API responses, and JWT tokens. DevOps engineers decode Kubernetes secrets (which are Base64-encoded) to inspect configuration values. Understanding the decoding process helps professionals at every level work more confidently with encoded binary data streams.

Step-by-Step Conversion Guide

  1. Identify and remove any whitespace from the Base64 string. Note whether it ends with one (=) or two (==) padding characters, which indicate the number of padding bytes.
  2. Map each Base64 character to its 6-bit decimal index value using the Base64 alphabet: A=0, B=1, …, Z=25, a=26, …, z=51, 0=52, …, 9=61, +=62, /=63.
  3. Write out the 6-bit binary representation for each index value, concatenating them into a single continuous bit stream.
  4. Split the bit stream into groups of 8 bits (one byte each). Discard any trailing padding bits that were added during encoding to reach a 6-bit boundary.
  5. Output each 8-bit group as the binary representation of that byte, separated by spaces for readability. For example, Base64 SGk= decodes to bytes 01001000 01101001 (Hi).
Base64 Character6-Bit Index6-Bit Binary
S18010010
G6000110
k36100100
= (padding)—00 (discarded)

Frequently Asked Questions

What does the = padding at the end of a Base64 string mean?

Base64 encodes data in 3-byte (24-bit) blocks and outputs 4 characters per block. When the original data is not a multiple of 3 bytes, the final block is shorter and right-padded with zero bits to reach a 6-bit boundary before encoding. To communicate exactly how many of those zero bits were padding (and should be discarded on decode), one = is appended when 1 padding byte was added, and two == when 2 padding bytes were added. This ensures decoders know the exact length of the original data.

What is the browser's atob() function and how does this tool use it?

atob() (ASCII to Binary) is a built-in JavaScript function that decodes a Base64 string into a binary byte string. This tool calls atob() on your input to retrieve the decoded raw bytes, then converts each byte's numeric value into its 8-bit binary representation to display the output. All processing happens in your browser — your input is never sent to a server.

What is the difference between standard Base64 and Base64URL?

Standard Base64 uses + and / as its 62nd and 63rd characters. These characters have special meanings in URLs and query strings, which can cause encoding conflicts when Base64 values are embedded in URLs. Base64URL is a URL-safe variant that replaces + with - and / with _, and usually omits padding = signs. JWT tokens use Base64URL encoding. This tool handles standard Base64; if you have Base64URL input, replace - with + and _ with / before pasting.

Why does the decoded binary have more bits than the Base64 characters suggest?

This is a natural consequence of the encoding ratio. Each Base64 character encodes 6 bits, but the binary output is grouped into 8-bit bytes. For every 4 Base64 characters you input (4 × 6 = 24 bits), you get back 3 bytes of binary output (3 × 8 = 24 bits). The total information content is identical — only the grouping changes. Apparent "extra" bits come from padding that was added during encoding and is discarded during decoding.

More Binary Tools