๐ฃ Hex to Binary Converter with Steps
By Shihab Mia ยท Updated 2026-07-18
Spaces and an optional 0x prefix are ignored. Digits 0-9 and A-F are allowed.
| Hex digit | Decimal | 4-bit binary |
|---|
This hex to binary converter turns any hexadecimal number into its binary value in one step, so FF becomes 11111111 and 1A becomes 11010. It shows the raw binary, a nibble-grouped form where each hex digit maps to its own 4 bits (FF becomes 1111 1111), the bit count, and the matching decimal and octal values. Everything runs in your browser, and it stays exact for very long hex strings using BigInt, well past the 8 or 32 bits most examples stop at.
What is the Hex to Binary Converter?
Hexadecimal, or hex, is a base 16 number system that uses sixteen symbols: the digits 0 through 9 and then the letters A, B, C, D, E and F to stand for the values 10 through 15. Binary is base 2 and uses only 0 and 1. The two systems fit together neatly because 16 is 2 to the power 4, which means every single hex digit maps to exactly four binary digits, a group known as a nibble. That clean four-to-one relationship is why hex is used so often as a short, readable stand-in for long binary strings in colors, memory addresses and byte dumps.
To convert hex to binary by hand you do not need to touch decimal at all. Take the hex value one digit at a time, left to right, and replace each digit with its fixed 4-bit binary pattern. The digit F is 1111, the digit A is 1010, the digit 1 is 0001, and so on. Write those nibbles side by side in the same order and you have the binary result. For the hex number FF, the first F becomes 1111 and the second F becomes 1111, giving the nibble form 1111 1111, which is 11111111 as a raw binary string equal to 255 in decimal.
The converter above shows both forms on purpose. The nibble-grouped view keeps every hex digit aligned to its own 4 bits, which makes it easy to spot which digit produced which bits and to catch a typo. The raw binary form simply drops the leading zeros of the most significant nibble so the number reads naturally: hex 1A expands to 0001 1010 as nibbles, but its raw binary is 11010 because the leading three zeros are not written. Both represent the same value, 26 in decimal.
Internally the tool parses the hex with BigInt, so the decimal, octal and binary results stay exact no matter how many digits you paste. Standard JavaScript number math is only reliable up to 53 bits, and a long hexadecimal value such as a 64-bit register or a hash fragment would quietly lose precision with a plain parseInt. Using BigInt means a 16-digit hex string, which is 64 bits, still converts to the true binary and decimal value rather than a rounded approximation.
When to use it
- Expanding a hex color, byte, or flag such as FF or C0 into its exact binary bit pattern.
- Checking a homework or exam answer when converting a hexadecimal number to binary by hand.
- Reading a memory address or register value from a debugger and seeing the underlying bits.
- Cross checking a hex value against its binary, decimal and octal forms while working on low level code.
How to use the Hex to Binary Converter
- Type or paste a hex number (0-9 and A-F, with an optional 0x prefix) into the input box, or tap an example button.
- Read the binary value at the top; it updates instantly as you type.
- Check the nibble groups line to see how each hex digit maps to its own 4 bits.
- Use the copy buttons to grab the binary, nibble, decimal, or octal result for use elsewhere.
Formula & method
Worked examples
Convert the hex number FF to binary.
- Split the hex into single digits: F and F.
- Replace the first F with its 4-bit nibble 1111.
- Replace the second F with its 4-bit nibble 1111.
- Join the nibbles in order: 1111 1111.
- Drop leading zeros for the raw form (there are none here): 11111111.
Result: FF in hex equals 11111111 in binary (nibbles 1111 1111), which is 255 in decimal and 377 in octal.
Convert the hex number 1A to binary.
- Split the hex into single digits: 1 and A.
- Replace 1 with its nibble 0001.
- Replace A (decimal 10) with its nibble 1010.
- Join the nibbles: 0001 1010.
- Drop the leading zeros of the first nibble for the raw form: 11010.
Result: 1A in hex equals 11010 in binary (nibbles 0001 1010), which is 26 in decimal and 32 in octal.
Every hex digit with its decimal value and 4-bit binary nibble
| Hex | Decimal | Binary (4-bit) |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Common hex values with their binary, decimal, and octal equivalents
| Hex | Binary | Decimal | Octal |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 8 | 10 |
| A | 1010 | 10 | 12 |
| F | 1111 | 15 | 17 |
| 10 | 10000 | 16 | 20 |
| 1A | 11010 | 26 | 32 |
| 80 | 10000000 | 128 | 200 |
| FF | 11111111 | 255 | 377 |
| 100 | 100000000 | 256 | 400 |
| C0FFEE | 110000001111111111101110 | 12648430 | 60177756 |
Common mistakes to avoid
- Padding the raw binary with extra leading zeros. The nibble form of 1A is 0001 1010, but the raw binary number is 11010, not 00011010. Leading zeros on the most significant nibble are not part of the value. Keep them only when you deliberately want a fixed width such as a full byte.
- Dropping leading zeros inside the number. Every hex digit except the first must expand to a full 4 bits. The 0 in hex A0 becomes 0000, so A0 is 1010 0000, not 1010 0. Skipping those interior zeros shifts and shrinks the value.
- Treating the letters as their alphabet position. In hex A is 10, B is 11, up to F which is 15. It is not the 1st or 6th letter of the alphabet. Convert the letter to its value 10 to 15 first, then to its 4-bit nibble.
- Assuming plain number math stays exact for long hex. Standard JavaScript numbers lose precision beyond 53 bits, so a long hexadecimal to binary conversion can drift. This tool uses BigInt so the binary and decimal results stay exact for any length you enter.
Glossary
- Hexadecimal
- A base 16 number system using the digits 0 to 9 and the letters A to F, where A to F stand for the values 10 to 15.
- Binary
- A base 2 number system that uses only the digits 0 and 1, where each position is worth twice the position to its right.
- Nibble
- A group of 4 bits. One hex digit maps to exactly one nibble, which is why hex is a compact shorthand for binary.
- Bit
- A single binary digit, either 0 or 1. It is the smallest unit of data in computing.
- 0x prefix
- A marker written in front of a number to show it is hexadecimal, as in 0xFF. It is not part of the value and is stripped before conversion.
- Most significant nibble
- The leftmost hex digit and its 4 bits, which carry the largest place value in the number.
Frequently asked questions
How do you convert hex to binary?
To convert hex to binary, replace each hexadecimal digit with its fixed 4-bit binary pattern and join them in order. For example F is 1111, so FF becomes 1111 1111, which is 11111111 as a raw binary number.
What is FF in binary?
Hex FF equals 11111111 in binary. Each F maps to the nibble 1111, so the two digits give 1111 1111, which is 255 in decimal and the largest value a single byte can hold.
What is 1A in binary?
Hex 1A equals 11010 in binary. The digit 1 is the nibble 0001 and A is 1010, giving 0001 1010, and dropping the leading zeros leaves 11010, which is 26 in decimal.
Why does each hex digit become exactly 4 bits?
Because 16 is 2 to the power 4, so one base 16 digit carries exactly the same information as four base 2 digits. That is why every hex digit maps cleanly to a 4-bit nibble.
Do I need to remove the 0x prefix first?
No. This converter automatically strips an optional 0x or 0X prefix and any spaces before converting, so both 0xFF and FF give the same binary result.
Can this converter handle very long hex numbers?
Yes. This hex to binary converter uses BigInt internally, so it keeps the binary and decimal results exact for hex strings well beyond 53 bits, unlike simple calculators that round large values.