Format Code Now
/
Encode & decodeBase64 to Binary Converter Next: Byte to ASCII Converter ›

Base64 to Binary Converter

ED-41

Paste a Base64 string and click Base64 to binary to see the 8-bit pattern of each decoded byte. Paste binary and click Binary to Base64 to go back.

Runs in your browser. Nothing is uploaded.

Base64 string or binary bytes

Result

How to use it

  1. Paste the Base64 string, with or without the = padding, into the input box.
  2. Pick how the 8-bit groups are separated: space, nothing, or a new line.
  3. Click Base64 to binary to see one 8-bit group per byte.
  4. To reverse it, paste groups of 8 bits, choose the alphabet and padding, and click Binary to Base64.

Decoded bytes, shown as bits

Base64 packs 3 bytes into 4 characters. The tool first decodes the Base64 into those bytes, then writes each byte as 8 binary digits. So SGVsbG8= becomes five groups, 01001000 01100101 01101100 01101100 01101111. The bytes do not have to be text, so you can inspect a file header, a key or any other raw data.

Accepted Base64 and binary

Both the standard alphabet (+ and /) and the URL-safe one (- and _) are read, and white space is ignored. Mixing the two alphabets, a bad character or wrong padding gives an error with a position. Binary input must be groups of 8 bits split by spaces, commas or line breaks, or one unbroken run whose length is a multiple of 8. Groups of 7 bits are rejected.

Error messages and what to do

MessageWhat it meansFix
Invalid Base64 characterThe input has a character that is not part of the Base64 alphabet.Remove it, or check that you copied the whole string without quotes or labels.
No Base64 data found.The input is empty or only white space.Paste a Base64 string such as SGVsbG8=.
is not a binary digitBinary input contains something other than 0 and 1.Use only 0 and 1, in groups of 8 bits.

Questions people ask

How do I convert Base64 to binary?

Decode the Base64 into bytes, then write each byte as 8 bits. This page does both steps. Paste the string, click Base64 to binary, and you get one 8-bit group per decoded byte, for example 01001000 for the letter H.

Why is the binary longer than the Base64 string?

Each Base64 character carries 6 bits, but binary is shown as 8-bit groups of the decoded bytes. Four Base64 characters hold 24 bits, which is 3 bytes, or 24 binary digits. The padding = adds no bits and is not shown.

Can it convert binary back to Base64?

Yes. Paste groups of 8 bits and click Binary to Base64. You can choose the standard or URL-safe alphabet and whether to add = padding. A group that is not 8 bits long is rejected, so pad short groups with leading zeros.

Does the Base64 have to be text?

No. The tool works on bytes, not characters, so it handles any Base64 input, including data from an image or a key. It does not try to read the bytes as text, which is why it never fails on non-UTF-8 data.

Does it accept URL-safe Base64?

Yes. Base64URL, which uses - and _ in place of + and /, is accepted, with or without padding. A string that mixes both styles is rejected with the position of the clash, because it is not valid in either form.

About this tool

Base64 to binary decodes the Base64 into bytes first, then writes each byte as 8 bits, so 4 Base64 characters become up to 24 bits and the = padding is not shown. The bytes do not have to be text, which makes this useful for looking at raw data. It accepts the standard and the URL-safe alphabet, ignores white space, and stops with a position on any other character or on mixed alphabets. Binary to Base64 reads groups of 8 bits separated by spaces, commas or line breaks, or one unbroken run whose length is a multiple of 8, and rejects groups that are not 8 bits long. Nothing is uploaded.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.