How to convert hex to binary
Converting hexadecimal (hex) to binary is straightforward once you know that each hex digit represents exactly four binary digits. Instead of converting hex to decimal first, you can translate each hex character directly into its four-digit binary equivalent, then string them together. This direct method is faster and less error-prone than the two-step route.
The process works because hex and binary are both powers of 2 — hex uses base 16 (2 to the 4th power) and binary uses base 2. That relationship means one hex digit always maps to four binary digits, with no remainder or overlap.
Key Takeaways
- Each hex digit (0–9 and A–F) converts to a four-digit binary sequence, and you can memorize or reference a simple conversion table.
- Write out the four-digit binary equivalent for each hex digit in order, then combine them into one continuous binary string.
- Leading zeros in the first group of four matter only if you need a specific bit length; otherwise they can be dropped from the final result.
- Hex is commonly used in computing for memory addresses and color codes, so this conversion skill applies to real tasks like reading error messages or web colors.
The hex-to-binary conversion table
Memorizing this table makes the conversion instant. Each row shows a hex digit and its four-bit binary equivalent:
| Hex | Binary | Hex | Binary |
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | A | 1010 |
| 3 | 0011 | B | 1011 |
| 4 | 0100 | C | 1100 |
| 5 | 0101 | D | 1101 |
| 6 | 0110 | E | 1110 |
| 7 | 0111 | F | 1111 |
Notice that A through F represent 10 through 15 in decimal. Once you see the pattern — each row counts up in both systems — the table becomes intuitive rather than something to memorize by rote.
Converting a hex number step by step
Take the hex number 2F7 as an example. You have three hex digits, so you will produce three groups of four binary digits.
First, convert each hex digit separately using the table: 2 becomes 0010, F becomes 1111, and 7 becomes 0111. Write them in order: 0010 1111 0111. Remove the leading zero from the first group (since it does not change the value) and you get 10111110111 in binary.
Another example: convert A3. A is 1010 and 3 is 0011, so you write 1010 0011. This time there is no leading zero to drop, so the binary result is 10100011.
The spaces between groups of four are optional — they just make the result easier to read and check. Many systems strip them out automatically.
Why leading zeros matter (and when they do not)
In the first example, 2F7 converted to 0010 1111 0111. The leading zero in the first group represents nothing — it does not change the value. In everyday math, we drop it and write 10111110111.
However, if you are working with a fixed bit width — say, a 16-bit memory address or an 8-bit color channel — you must keep those leading zeros. A color code of 0F in hex must become 00001111 in binary (8 bits), not 1111, because the system expects exactly 8 bits. Always check whether your context requires a specific length.
Real-world uses for hex-to-binary conversion
Web colors are written in hex: #FF5733 means red channel FF, green channel 57, blue channel 33. If you want to understand how bright each channel is at the bit level, you convert each pair to binary. FF becomes 11111111 (all bits on, maximum brightness), and 57 becomes 01010111.
Memory addresses in debugging output often appear in hex. When you see an error pointing to address 0x7FFF, converting to binary can help you spot patterns or understand alignment — for instance, whether an address falls on a 4-byte or 8-byte boundary.
Network engineers use hex for MAC addresses and IP subnetting. Firmware and embedded systems frequently display values in hex for compactness, and technicians convert to binary to read individual bit flags or status registers.
Common mistakes to avoid
The most frequent error is forgetting that each hex digit must produce exactly four binary digits, including leading zeros within each group. If you convert F to 1111 but then convert 3 to 11 instead of 0011, your result will be wrong by one bit position.
Another mistake is confusing hex letters. A through F represent 10 through 15, not 1 through 6. Write them out or reference the table until the mapping is automatic.
Finally, do not drop leading zeros from the middle or end of your result — only from the very beginning if the context allows it. The binary string 10100011 is correct; 1100011 is wrong because you have lost a bit.
Frequently Asked Questions
Can I convert hex to binary without memorizing the table?
Yes. Convert each hex digit to decimal first (A=10, B=11, etc.), then convert that decimal to four-bit binary. It takes longer, but it works. For speed, though, the direct table lookup is worth learning — it is only 16 entries and becomes automatic with a few uses.
What if my hex number has a letter I do not recognize?
Hex uses only 0–9 and A–F. If you see a G or higher, it is not valid hex. Double-check the source. Hex is case-insensitive, so A and a mean the same thing.
Do I need to keep spaces between the groups of four binary digits?
No. Spaces are optional and exist only to make the result easier to read and verify. Most systems and calculators strip them out. Use them while you are learning, then drop them if your context does not require them.
Why not just convert hex to decimal, then decimal to binary?
You can, but it is slower and introduces more chances for arithmetic errors. The direct hex-to-binary method skips the middle step because hex and binary are both powers of 2. For a number like ABCD, direct conversion takes seconds; the decimal route takes longer and is more error-prone.