Home / Encoding tools / Hex to binary

Hex to Binary Converter

Enter a hexadecimal number and get its binary form. Each hex digit becomes four bits, and the table shows the match.

Digit by digit

Convert a list

Quick reference

One digit, four bits

To convert hex to binary, replace every hex digit with its four-bit pattern. There is no arithmetic and no division.

3F  =  0011 1111
A5  =  1010 0101

Colors as an example

A web color such as #FF8800 is three bytes: FF, 88 and 00. In binary they are 11111111, 10001000 and 00000000, which are the red, green and blue levels from 0 to 255.

Options

  • Group bits in fours: adds a space between nibbles so the result is easier to read.
  • Pad to whole bytes: adds zeros on the left until the length is a multiple of 8.
  • Remove leading zeros: shortens the result, so 0F becomes 1111.
  • 0b prefix: writes 0b in front, as many languages expect.

Hex bytes as text

If your hex is a series of bytes, the tool also tries to read it as UTF-8 text. The hex 48 65 6C 6C 6F is the text Hello. If the bytes are not valid text, it says so. A prefix such as 0x, a leading # and spaces are all accepted.

Batch conversion

Paste one hex number per line in the list box to convert many at once.

For the reverse direction, use binary to hex. To see the decimal value, try binary to decimal. The guide to binary numbers explains the system from the start.

Frequently asked questions

How do I convert hex to binary?

Replace each hex digit with its four-bit binary value. For example, 3 is 0011 and F is 1111.

What is A5 in binary?

10100101. A is 1010 and 5 is 0101.

Can it read hex as text?

Yes. If the hex is a series of bytes that form valid UTF-8, the text appears below the result.

Does it accept 0x and spaces?

Yes. A 0x or # prefix, spaces and underscores are ignored.