Skip to the tool
Binary Translator Free tools

Hex to binary converter

Type hex to get binary. Each hex digit becomes four bits.

Updated · Written and checked by Murugan Vellaichamy

Waiting for input

Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.

Result
Try:

How to convert hex to binary

Replace each hex digit with its four-bit pattern from the table and join the groups. D is 1101 and 6 is 0110, so D6 is 1101 0110. You can drop leading zeros from the very first group if you don’t need a fixed width.

Hex to binary chart

HexBinaryHexBinary
0000081000
1000191001
20010A1010
30011B1011
40100C1100
50101D1101
60110E1110
70111F1111

Common mistakes

Dropping leading zeros of a digit

Writing 3 as 11 inside a number, so 3F becomes 11 1111

Instead: Write every hex digit as four bits: 3F is 0011 1111

Mixing up B and D

B is 1011 (11); D is 1101 (13)

Instead: Use the table above, or count up from A = 1010

Reading 0x as digits

Treating the x in 0x1F as a digit

Instead: 0x only marks the number as hex; ECMA-262 also uses 0b and 0o for binary and octal

Where you read hex as bits

Flags and masks: the value 0x05 sets bits 0 and 2 (0000 0101), and AND-ing a byte with 0x0F keeps its low four bits. The bit workbench lets you click the bits of any hex value to see what each one means.

Sources and method

Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.

Questions

Why does each hex digit become exactly four bits?

Because 16 = 24. Four bits can hold 16 values, 0000 to 1111, which match the 16 hex digits 0 to F.

How do I keep leading zeros?

Tick “Read as signed” and pick a width; the result is then shown at that full width, for example 0x1F as 00011111 in 8 bits.

Can I paste hex bytes from a dump?

For a single number, yes. To turn a list of hex bytes into text, paste them into the binary translator on the home page, which reads hex byte pairs.

More converters

Copied