Base64 to Binary Converter – Free

Paste a Base64 string and this Base64 to binary converter shows the decoded bytes as groups of eight bits. Decoding is done locally in your browser.

How to use the Base64 to Binary tool

  1. Paste the encoded string into the Base64 box, or select Example to load SGk=.
  2. Select Convert. Line breaks and spaces inside the string are ignored.
  3. Read the decoded bytes in the Result box as space-separated 8-bit groups.
  4. Select Copy to copy the bit string, or Clear to paste another value.

How Base64 to binary decoding works

Base64, defined in RFC 4648, represents bytes with 64 characters. Each character stands for a number from 0 to 63, which is six bits. The decoder replaces every character with its six bits, joins them into one long bit string and cuts that string into 8-bit bytes. Four characters carry 24 bits, which is exactly three bytes.

This tool stops there and shows you the bytes as bits. It does not try to interpret them as text or as a file, so it works for any payload: keys, hashes, images or compressed data.

Worked example: TWFu and SGk=

The characters T, W, F and u have the values 19, 22, 5 and 46. As six-bit groups they are 010011 010110 000101 101110. Regrouped by eight, the same 24 bits are 01001101 01100001 01101110, the bytes of the word Man.

SGk= shows what padding does. S, G and k are 18, 6 and 36, or 010010 000110 100100. That is 18 bits: two full bytes, 01001000 and 01101001, plus two spare zero bits that are thrown away. The equals sign marks the short final group.

TWFu  ->  01001101 01100001 01101110
SGk=  ->  01001000 01101001

Input the decoder accepts

The tool recognizes the two alphabets from RFC 4648 and is tolerant about layout. If you are decoding a PEM block, paste only the body and leave out the BEGIN and END lines.

  • Standard Base64 with + and /.
  • URL-safe Base64 with - and _. If either character appears, the whole input is read as URL-safe.
  • Padded or unpadded strings. SGk and SGk= decode to the same two bytes.
  • Strings wrapped over several lines or containing spaces, as in the body of a MIME part.

Why you might see Enter valid Base64

The decoder validates strictly and reports one message for every malformed input. Check for these causes.

  • A data URL prefix. Its colon, semicolon and comma are outside the alphabet, so remove everything up to and including base64, before converting.
  • Characters outside the alphabet, such as quotes, a percent sign or a backslash.
  • Both alphabets in one string, for example + together with _.
  • Padding in the wrong place: an equals sign in the middle, more than two at the end, or a padded length that is not a multiple of four.
  • A single leftover character after the last group of four, which cannot hold a whole byte.
  • Leftover bits that are not zero. SGl= is rejected because its last character carries bits that no byte uses.

Output format and size

Each byte is printed most significant bit first and padded to eight digits, with one space between bytes. An empty box returns Enter a Base64 value. The code sets no maximum length, but the output is nearly seven times longer than the input, so very large pastes make the Result box slow. To see the same bytes more compactly, use Base64 to Hex. To read them as text, use the Base64 to Text Decoder.

Frequently asked questions

How many bits does one Base64 character represent?

Six. The alphabet has 64 symbols, and 64 is two to the sixth power. Four characters therefore hold 24 bits, or three bytes, which is why Base64 output is about one third larger than the raw data.

Does this tool decode Base64URL?

Yes. When the input contains - or _, it is treated as the URL-safe alphabet from RFC 4648 section 5. JWT segments and similar unpadded values decode without any editing.

What is the difference between Base64 to Binary and Base64 to Hex?

Both decode the same bytes. This tool prints each byte as eight binary digits, which suits bit-level work such as checking flags. The hex version prints two hex digits per byte, which is shorter and easier to compare.

Is my Base64 data uploaded?

No. The string is decoded by JavaScript in your browser. Tokens, keys and other sensitive values you paste are not sent over the network by this page.

Related tools