How to use the Binary to Hex Converter
Paste a binary number. The hex value appears in upper case, ready to copy.
How to convert binary to hex
Split the binary number into groups of four bits starting from the right, adding leading zeros to the last group if needed. Replace each group with its hex digit, from 0 for 0000 to F for 1111. 1010 0101 1111 becomes A, 5 and F, so the answer is A5F.
Why hex is used for binary data
A byte is eight bits, which is exactly two hex digits, so hex lines up neatly with memory addresses, colour codes, MAC addresses and hash values. It is far shorter than binary and easier to read aloud than long runs of ones and zeros.
How it works
Group the bits in fours from the right.
Examples
- 101001011111
A5F
- 11111111
FF
- 1000000
40
Binary to hex table (4-bit groups)
| Binary | Hex |
|---|---|
| 0000 | 0 |
| 0001 | 1 |
| 0010 | 2 |
| 0011 | 3 |
| 0100 | 4 |
| 0101 | 5 |
| 0110 | 6 |
| 0111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | A |
| 1011 | B |
| 1100 | C |
| 1101 | D |
| 1110 | E |
| 1111 | F |
Limitations and assumptions
Runs entirely in your browser. Nothing you enter is uploaded.
Frequently asked questions
How do I convert binary to hex?
Group the bits in fours from the right, pad the leftmost group with zeros, then swap each group for its hex digit using the table above.
What is 11111111 in hex?
FF. Each group of four ones is F, and the two groups together make one byte.
Do I need to pad the left side?
Only when you work by hand. 101 becomes 0101, which is 5 in hex. The converter adds the leading zeros for you.
How do I convert hex back to binary?
Use the hex to binary converter, or replace each hex digit with its four-bit group from the table above.