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 number Hexadecimal number
Binary number

The same number in every base
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.

DigitDecimal valueBits

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.

Hexadecimal digits converted to 4-bit binary groups0x2F0010 1111Hex toBinary

How to use the hex to binary converter

  1. Enter a hex value, such as 2F or 0xDEADBEEF.
  2. Copy the binary result. It is grouped in nibbles by default; choose bytes or no spaces instead.
  3. 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:

HexBinaryDecimalHexBinaryDecimal
000000810008
100011910019
200102A101010
300113B101111
401004C110012
501015D110113
601106E111014
701117F111115

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

HexBinaryDecimal
A51010 0101165
7F0111 1111127
801000 0000128
FF1111 1111255
1F40001 1111 0100500
FF001111 1111 0000 000065,280
CAFE1100 1010 1111 111051,966
DEADBEEF1101 1110 1010 1101 1011 1110 1110 11113,735,928,559

Where hex to binary helps

  • Bit masks: 0x0F is 0000 1111 (the low nibble), 0xF0 is 1111 0000 and 0x80 is 1000 0000, the top bit of a byte. Try them in the binary calculator.
  • Colors: #4F46E5 is 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 0db8 is 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.