Free · No signup · Runs in your browser
Binary to Hex Converter
Convert binary to hexadecimal in one step. The tool groups your bits into nibbles of four and shows each hex digit.
This tool needs JavaScript. Please enable it in your browser to use it.
- Instant results as you type
- Step-by-step working
- Private: input stays in your browser
- Free, no signup
To convert binary to hexadecimal, split the binary into groups of 4 bits starting from the right, then replace each group with its hex digit (0-9, A-F). For example, 1010 1111 becomes AF.
How to use the binary to hex converter
- Enter a binary number. Spaces and a 0b prefix are fine.
- Read the hexadecimal result, shown with or without a 0x prefix.
- Open Show the steps to see each 4-bit group mapped to a hex digit.
Examples
| Binary | Hexadecimal |
|---|---|
| 1111 | F |
| 10101010 | AA |
| 11111111 | FF |
| 1010111100001111 | AF0F |
| 1100100100001111 | C90F |
Why four bits make one hex digit
Sixteen is 2 to the power 4, so exactly four bits are needed to count from 0 to 15. That makes hex a compact way to write binary: one hex digit stands for one nibble, and two hex digits stand for one byte.
| Binary (4 bits) | Decimal | Hex |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | 10 | A |
| 1011 | 11 | B |
| 1100 | 12 | C |
| 1101 | 13 | D |
| 1110 | 14 | E |
| 1111 | 15 | F |
How to do it by hand
- Pad the binary on the left with zeros until its length is a multiple of 4.
- Split it into groups of four bits.
- Replace each group using the table above.
Example: 101111 becomes 0010 1111, which is 2F.
Where you will see it
- Color codes in web design, such as #1E90FF, where each pair of hex digits is one byte.
- Memory addresses and machine code.
- MAC addresses and checksums.
To convert the other way, use the hex to binary converter.
Binary to hex converter FAQ
What is 1111 in hex?
1111 in binary is F in hexadecimal (decimal 15).
What is 11111111 in hex?
11111111 is FF, the largest one-byte value (255).
Do I need to add leading zeros?
No. The tool pads the left side automatically.
What does the 0x prefix mean?
It marks a number as hexadecimal in many programming languages. You can switch it on in the options.
Can I convert hex to decimal?
Convert hex to binary first with the hex to binary converter, then use binary to decimal.
