Hex to Binary Converter
To convert hex to binary, replace each hexadecimal digit with its 4-bit binary value and join the groups. Enter a hex number below to see the expansion digit by digit.
Binary result
0011 1111
Decimal value of the input: 63
Working
- Each hex digit becomes exactly 4 bits.
- 3 = 3 = 0011
- F = 15 = 1111
- Join the groups: 0011 1111.
Example: 3F to binary
- Each hex digit becomes exactly 4 bits.
- 3 = 3 = 0011
- F = 15 = 1111
- Join the groups: 0011 1111.
- Result: 0011 1111 (decimal 63)
One digit, four bits
Each hex digit stands for a value from 0 to 15, and any such value fits in exactly four bits. So 3 is 0011, A (10) is 1010 and F (15) is 1111. The leading zeros inside a group matter: they keep every digit four bits wide, which is what lets the groups line up into bytes.
The tool accepts upper or lower case, ignores spaces and underscores, and accepts a leading 0x. The result is shown in groups of four bits separated by spaces, and the decimal value of your input is displayed as a cross-check.
Reading hex as bytes
Two hex digits make one byte, so FF is 11111111 and a six-digit colour code such as a web colour is three bytes. If you convert an odd number of hex digits, the first group is still four bits, so the total is not a multiple of 8; pad on the left if you need whole bytes.
Common mistakes
Letters outside A to F, such as G, are not hex digits and the tool will point them out. Also remember that the 0x prefix is only a marker; it is not part of the number. A common slip is reading the letter O as the digit 0, or the letter l as 1, when copying hex by eye; if the tool reports a digit you cannot see, check for look-alike characters.
Hex to binary is the reverse of binary to hex, so you can use the two converters together to check a value both ways.
Frequently asked questions
- What is hex A in binary?
- A is decimal 10, which is 1010 in binary.
- How many bits are in two hex digits?
- Eight, which is one byte.
- Does the case of the hex digits matter?
- No. ff, FF and Ff are the same value.
- Is 0x part of the value?
- No. It only tells readers the number is hexadecimal; the converter strips it.