Hex to Binary Converter
Convert hex to binary instantly: every hex digit becomes exactly 4 bits. Group the result in nibbles or bytes, keep leading zeros, and swap direction to convert binary to hex.
Each hex digit becomes 4 bits and leading zeros are kept, so 0F gives 0000 1111. A 0x or # prefix is ignored.
Binary digits are grouped in fours from the right, and each group becomes one hex digit.
| Binary | | |
|---|---|---|
| Octal | | |
| Decimal | | |
| Hex | | |
| Bit length | |
Show steps
Every hex digit is exactly 4 bits and every octal digit is exactly 3 bits, so each digit is converted on its own and the groups are joined.
| Digit | Decimal value | Bits |
|---|
Convert Hexadecimal to Binary Online
Hex is shorthand for binary: one hex digit is exactly four bits, called a nibble. That makes hex to binary the easiest base conversion there is, and this converter does it instantly for values of any length.
Leading zeros are kept, so a byte such as 0F stays eight bits (0000 1111). The steps table lists the nibble for every digit, and the swap button turns the tool into a binary to hex converter.
How to use the hex to binary converter
- Enter a hex value, such as
2For0xDEADBEEF. - Copy the binary result. It is grouped in nibbles by default; choose bytes or no spaces instead.
- Need the reverse? Click Swap direction to convert binary to hex.
Hex to binary table: all 16 nibbles
Learn this table and you can convert any hex number in your head:
| Hex | Binary | Decimal | Hex | Binary | Decimal |
|---|---|---|---|---|---|
0 | 0000 | 0 | 8 | 1000 | 8 |
1 | 0001 | 1 | 9 | 1001 | 9 |
2 | 0010 | 2 | A | 1010 | 10 |
3 | 0011 | 3 | B | 1011 | 11 |
4 | 0100 | 4 | C | 1100 | 12 |
5 | 0101 | 5 | D | 1101 | 13 |
6 | 0110 | 6 | E | 1110 | 14 |
7 | 0111 | 7 | F | 1111 | 15 |
How to convert hex to binary by hand
Replace each hex digit with its 4-bit pattern from the table and write the groups side by side. No arithmetic is needed. 2F becomes 0010 and 1111, so 2F = 0010 1111. A longer value works the same way: 7E3 is 0111 1110 0011.
The leading zeros of the first group can be dropped (101111 is the same number), but keeping them shows the full byte, which is what you want for bit masks and memory dumps.
Binary to hex
To go back, split the binary into groups of four starting from the right, pad the leftmost group with zeros and look up each group. 101111 becomes 0010 1111, which is 2F. Use the swap button above to do this automatically. Octal works the same way with groups of three bits: 101 111 is 57 in octal.
Hex to binary examples
| Hex | Binary | Decimal |
|---|---|---|
A5 | 1010 0101 | 165 |
7F | 0111 1111 | 127 |
80 | 1000 0000 | 128 |
FF | 1111 1111 | 255 |
1F4 | 0001 1111 0100 | 500 |
FF00 | 1111 1111 0000 0000 | 65,280 |
CAFE | 1100 1010 1111 1110 | 51,966 |
DEADBEEF | 1101 1110 1010 1101 1011 1110 1110 1111 | 3,735,928,559 |
Where hex to binary helps
- Bit masks:
0x0Fis 0000 1111 (the low nibble),0xF0is 1111 0000 and0x80is 1000 0000, the top bit of a byte. Try them in the binary calculator. - Colors:
#4F46E5is 0100 1111, 0100 0110 and 1110 0101: one byte per channel. The HEX to RGB converter gives the decimal channels. - Networking: MAC and IPv6 addresses are written in hex. The IPv6 group
0db8is 0000 1101 1011 1000.
Frequently Asked Questions
Common questions about converting hexadecimal to binary.
Replace each hex digit with its 4-bit binary value and join them. A5 is 1010 and 0101, so 1010 0101.
F is 15, which is 1111 in binary: all four bits set.
FF is 1111 1111, eight 1s, which is 255 in decimal.
Because 16 = 2 × 2 × 2 × 2. Four bits have exactly 16 combinations, from 0000 to 1111, matching the 16 hex digits.
A nibble is half a byte: 4 bits, or one hex digit. A byte is two nibbles, so it is always two hex digits.
For a pure number you can drop them: 0010 1111 and 101111 are equal. For bytes, masks and registers, keep them so each digit stays 4 bits.
Group the bits in fours from the right and convert each group. Use the Swap direction button above to do it automatically.
Use the hex to decimal converter, which multiplies each digit by its power of 16.