gettoolz.app

Hex to binary converter

Convert hex numbers to binary — every hex digit becomes 4 bits. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.

Part of developer tools.

Base

Binary

10101101

Octal

255

Decimal

173

Hexadecimal

AD

Hex to binary table

DecimalHexBinary
000
111
2210
3311
44100
55101
66110
77111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111
161010000
100641100100
1277F1111111
255FF11111111
256100100000000
10003E81111101000
102440010000000000
409610001000000000000
65535FFFF1111111111111111
4294967295FFFFFFFF11111111111111111111111111111111
18446744073709551615FFFFFFFFFFFFFFFF1111111111111111111111111111111111111111111111111111111111111111

The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.

How to convert hex to binary

Replace each hex digit with its 4-bit binary value, keeping the leading zeros inside each group — hex 1 is 0001, not 1 — and join the groups in order. For AD: A → 1010, D → 1101, giving 1010 1101. Nothing is carried from one digit to the next, so a long hex number converts as easily as a short one.

Hex and binary side by side

The largest 16-bit value is FFFF in hex and 1111111111111111 in binary: 4 digits against 16. Every hex digit is exactly 4 bits, so the lengths stay in a fixed ratio and any stretch of digits can be converted without looking at its neighbours. Binary is what bit masks, flags and subnet masks are reasoned in: a /24 network mask is twenty-four 1 bits followed by eight 0 bits, 255.255.255.0 once written in decimal. In JavaScript and Python source, 173 is written 0xAD in hex and 0b10101101 in binary. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — hex on this page.

Other conversions

Going the other way? Binary to hex converter.

Or open the full number base converter and see a number in all four bases at once.