Using the converter
Type a hex number, like 1F4 or 0x1F4, and the binary appears straight away, with each digit's four bits listed underneath. Capitals and lowercase both work. Set the binary to groups of 4 to keep the bits lined up with the hex digits they came from.
Several numbers can go in at once, separated by spaces, commas or new lines. Press swap to turn binary back into hex.
How to convert hex to binary
Replace each hex digit with its four bits, then join them up. 1F4 is 1, F and 4, which are 0001, 1111 and 0100, so it's 0001 1111 0100, or 111110100 once the zeros at the front are dropped.
It works because 16 is 2⁴, so every hex digit stands for exactly four binary digits and nothing carries from one to the next. There's no need to go through decimal. The table below lists the bits for every digit from 0 to F, and after a few uses most people know them by heart.
Why hex is used for binary
Long strings of 1s and 0s are hard to read and easy to miscopy. Hex packs them four to a digit, so a byte is two digits and a 32-bit value is eight, and the bits are still easy to recover. Memory addresses, colour codes, MAC addresses and byte dumps are all written in hex for that reason.
Questions
What is F in binary?
1111. F is 15, and 8 + 4 + 2 + 1 = 15.
What is FF in binary?
1111 1111, eight 1s, which is 255, the largest value one byte can hold.
Why do some answers start with zeros?
With groups of 4 switched on, the first group is padded to four bits so every group lines up with a hex digit. The zeros don't change the value.
How do I turn hex into text instead?
If the hex is bytes of text, like 48 65 6C 6C 6F, use the hex to text converter, which reads each pair of digits as a character.
Decimal, binary, octal and hex from 0 to 32
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
| 19 | 10011 | 23 | 13 |
| 20 | 10100 | 24 | 14 |
| 21 | 10101 | 25 | 15 |
| 22 | 10110 | 26 | 16 |
| 23 | 10111 | 27 | 17 |
| 24 | 11000 | 30 | 18 |
| 25 | 11001 | 31 | 19 |
| 26 | 11010 | 32 | 1A |
| 27 | 11011 | 33 | 1B |
| 28 | 11100 | 34 | 1C |
| 29 | 11101 | 35 | 1D |
| 30 | 11110 | 36 | 1E |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
Decimal, binary, octal and hex from 0 to 32stringmash.com/hex-to-binary
Sources
Added and reviewed . What's new






