Hexadecimal to binary

Convert hexadecimal to binary as you type, with any number of digits, the method step by step and a reference table.

loading Hexadecimal to binary
About this tool

Hexadecimal and binary

Hexadecimal (base 16) writes each group of 4 bits as one digit from 0 to F, so one byte is always two hex digits; it is the language of memory addresses, colors and hashes. Binary (base 2) is how hardware stores every number: each digit is a bit, worth a power of 2.

Expanding hex into bits is how you read individual flags of a status register, a TCP header field or a permission mask.

This page opens the base converter with hexadecimal as the input; it shows binary, octal, decimal, hexadecimal and Base64 at once, accepts prefixes such as 0x, 0b and 0o, and works with numbers of any length (no 2^53 limit). It runs in your browser.

Hexadecimal vs binary

Hexadecimalbinary
Base162
Digits0–9 A–F0 1
Prefix in code0x0b
255 is writtenFF11111111

How to convert hexadecimal to binary by hand

No arithmetic needed: each 4 bits are one hexadecimal digit. Group the bits from the right (pad with zeros on the left) and translate each group:

Bits1011001100101101
DigitB32D

So 1011001100101101 = B32D (decimal 45869).

Hexadecimal to binary table

Values computed by the converter itself:

HexadecimalBinary
00
11
210
7111
81000
A1010
F1111
1010000
20100000
401000000
641100100
7F1111111
FF11111111
100100000000
3E81111101000
40010000000000
10001000000000000
FFFF1111111111111111

Hexadecimal to binary in code

JavaScript

(parseInt('9C', 16)).toString(2); // '10011100'

Python

format(int("9C", 16), "b")  # '10011100'

For integers beyond 2^53 in JavaScript, use BigInt: BigInt("0x…").toString(2).

Frequently asked questions

Does it handle very large numbers?

Yes. The converter uses arbitrary-precision integers (BigInt), so a 256-bit hash or a 100-digit number converts exactly; JavaScript Number would lose digits above 2^53.

Can I convert negative numbers or fractions?

Negative integers keep their sign (-255 → -FF); the tool does not write two’s complement or fractional digits. For a two’s complement byte, add 256 first (−1 → 255 → FF).

Why do programmers use hexadecimal instead of binary?

Because it is binary in short form: 4 bits per digit, 2 digits per byte, so 0xFF is easier to read than 11111111 and still maps bit for bit.

Report a problem