Hexadecimal (Base 16) to Binary (Base 2) Converter
Convert hexadecimal numbers to binary.
FF (base 16) = 11111111 (base 2)
Digits in base 16: 0 to 9 and A to F. Digits in base 2: 0 and 1.
How to convert Hexadecimal to Binary
Every positional number system works the same way: a digit is worth its own value times the base raised to the power of its position. In base 16 the place values, from the right, are 160 = 1, 161 = 16, 162 = 256 and so on.
Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 16 number into decimal, then divide by 2 and read the remainders from the bottom up. Two short steps, and you can check the number in the middle.
Because 16 is a power of 2, there is a faster way that skips decimal. Each base 16 digit is exactly 4 bits, so replace every digit with its 4-bit pattern and you are done.
The method
decimal value = each digit × its place value, all added upplace values in base 16: 1, 16, 256, 4096, 65536, and so ondivide by 2, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to first1 base 16 digit = 4 bitsdigits in base 16: 0 to 9 and A to Fdigits in base 2: 0 and 1
Worked example 1: 2D from hexadecimal to binary
Step 1: base 16 to decimal2D (base 16) = 2 × 161 + 13 × 160= 32 + 13= 45Step 2: decimal to base 245 ÷ 2 = 22 remainder 122 ÷ 2 = 11 remainder 011 ÷ 2 = 5 remainder 15 ÷ 2 = 2 remainder 12 ÷ 2 = 1 remainder 01 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 1011012D (base 16) = 101101 (base 2)
Letters stand for values from 10 up: A = 10, B = 11, C = 12 and so on. Remainders come out last digit first, which is why you read them from the bottom up. Digits that are 0 add nothing to the sum, so they are left out of the expansion.
Worked example 2: FF from hexadecimal to binary
Step 1: base 16 to decimalFF (base 16) = 15 × 161 + 15 × 160= 240 + 15= 255Step 2: decimal to base 2255 ÷ 2 = 127 remainder 1127 ÷ 2 = 63 remainder 163 ÷ 2 = 31 remainder 131 ÷ 2 = 15 remainder 115 ÷ 2 = 7 remainder 17 ÷ 2 = 3 remainder 13 ÷ 2 = 1 remainder 11 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 11111111FF (base 16) = 11111111 (base 2)
Worked example 3: 3E8 from hexadecimal to binary
Step 1: base 16 to decimal3E8 (base 16) = 3 × 162 + 14 × 161 + 8 × 160= 768 + 224 + 8= 1,000Step 2: decimal to base 21,000 ÷ 2 = 500 remainder 0500 ÷ 2 = 250 remainder 0250 ÷ 2 = 125 remainder 0125 ÷ 2 = 62 remainder 162 ÷ 2 = 31 remainder 031 ÷ 2 = 15 remainder 115 ÷ 2 = 7 remainder 17 ÷ 2 = 3 remainder 13 ÷ 2 = 1 remainder 11 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 11111010003E8 (base 16) = 1111101000 (base 2)
Worked example 4: B5 with the bit-group shortcut
B5 (base 16)Write each digit as 4 bits: B = 1011, 5 = 0101Join them and drop leading zeros: 10110101B5 (base 16) = 10110101 (base 2)
Both bases are powers of 2, so there is no need to go through decimal.
Need the other direction? Open the Binary to Hexadecimal converter.
Hexadecimal to Binary examples
The decimal number 255 is written FF in hexadecimal and 11111111 in binary.
| Hexadecimal | Binary | Decimal |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 10 | 2 |
| 7 | 111 | 7 |
| 8 | 1000 | 8 |
| A | 1010 | 10 |
| F | 1111 | 15 |
| 10 | 10000 | 16 |
| 20 | 100000 | 32 |
| 40 | 1000000 | 64 |
| 64 | 1100100 | 100 |
| FF | 11111111 | 255 |
| 3E8 | 1111101000 | 1000 |
Where Hexadecimal to Binary comes up
Hexadecimal (base 16) uses 0 to 9 and A to F, and each hex digit stands for exactly four bits, so one byte is always two hex digits. You see it in web colours like #FF8800, memory addresses, MAC addresses, hash values and byte dumps.
Binary uses only 0 and 1, because a digital circuit has two stable states: off and on. Every number a computer stores is binary underneath. You meet it when you work with bit flags, bit masks, subnet masks and low-level debugging.
Going to a smaller base spreads the same value over more digits, so the result is longer. The number 255 needs 2 digits in hexadecimal and 8 in binary.
Hexadecimal to Binary FAQ
How do I convert hexadecimal to binary?
Convert to decimal first by adding up each digit times its place value, then divide that decimal number by 2 repeatedly and read the remainders from last to first. Because both bases are powers of 2, you can also skip decimal and work with groups of bits.
Which digits does hexadecimal use?
Base 16 uses the digits 0 to 9 and A to F. For example, G is not a valid digit in base 16. Letters are not case sensitive on this converter, and results are shown in capitals.
Will the binary number be longer or shorter?
Longer. Going to a smaller base spreads the same value over more digits, so the result is longer. Roughly 4 binary digits for every hexadecimal digit. The number 255 needs 2 digits in hexadecimal and 8 in binary.
Is there a shortcut for hexadecimal to binary?
Yes. Because 16 is a power of 2, there is a faster way that skips decimal. Each base 16 digit is exactly 4 bits, so replace every digit with its 4-bit pattern and you are done.
Can I convert negative numbers or fractions?
The converter handles whole numbers, and a leading minus sign works for negatives. Fractions use a different method, where you repeatedly multiply the fractional part by the new base, and they are not supported here.