Skip to content

Hex to Binary Converter

Paste a hex value to see its bits: each hex digit becomes exactly four binary digits, written side by side.

Hex uses only 0–9 and A–F

In binary (base 2)

10100111

Hex A7 is 1010 0111 in binary (base 2).

27128
2664
2532
2416
238
224
212
201

128 + 32 + 4 + 2 + 1 = 167

Tap a bit to flip it. Each tile is worth its digit × 2n.

How to convert hex to binary

Write each hex digit as its four-bit pattern and put the patterns side by side. Every digit gets all four bits, including leading zeros, so 3 is written 0011 and not 11.

For 3C9: 3 = 0011, C = 1100, 9 = 1001, so the bits are 0011 1100 1001. Zeros at the very front can then be dropped: 1111001001.

Bit masks are easier to see this way. 0x0F keeps the low four bits of a byte (0000 1111) and 0xF0 keeps the high four (1111 0000), which is why low-level code is written in hex.

1 hex digit = 4 bits; 8 = 1000, A = 1010, F = 1111

Common hex bytes in binary

Bytes that come up as masks, characters and markers, written out bit by bit.

Bytes that come up as masks, characters and markers, written out bit by bit.
HexBinaryCommon use
000000 0000all bits off
010000 0001lowest bit
0F0000 1111low-nibble mask
200010 0000ASCII space; the bit that changes letter case
300011 0000ASCII digit 0
410100 0001ASCII A
550101 0101alternating bits, a test pattern
610110 0001ASCII a
7F0111 1111largest signed byte; ASCII DEL
801000 0000top bit; smallest signed byte (−128)
Show all 15 rows
AA1010 1010alternating bits, the other phase
C01100 0000two top bits
F01111 0000high-nibble mask
FE1111 1110all bits but the lowest
FF1111 1111all bits on; −1 as a signed byte

Frequently Asked Questions

What is F in binary?

F is 15, which is 1111: all four bits of a nibble set. FF is 1111 1111.

Do I keep the leading zeros?

Inside the number, yes: every hex digit needs all four bits or the bits after it shift. At the very front they can be dropped because they do not change the value, though fixed-width fields (a byte, a register) keep them.

How many bits is a hex number?

Four per digit: 2 hex digits is 8 bits, 4 is 16 bits, 8 is 32 bits and 16 is 64 bits.