Binary to Hexadecimal Converter
Convert binary numbers to hexadecimal instantly, or reverse the process and convert hexadecimal values into binary. Enter a number using 0s and 1s, choose your preferred output format, and copy the result. The converter also supports long binary strings without relying on JavaScript's limited integer precision.
Enter only 0s and 1s. Spaces, line breaks and underscores can be used as visual separators.
How to convert binary to hexadecimal
Hexadecimal is a base-16 number system. It uses the digits 0–9 and the letters A–F, where A represents 10, B represents 11, and F represents 15. Each hexadecimal digit represents exactly four binary bits.
- Start with the binary number.
- Group the bits into sets of four, starting from the right.
- If necessary, add leading zeros to complete the leftmost group.
- Convert each four-bit group into its matching hexadecimal digit.
- Combine the hexadecimal digits in the same order.
Example: convert 11010110 to hexadecimal
Split the binary value into two groups of four bits:
1101 0110
The binary group 1101 equals decimal 13, which is
hexadecimal D. The group 0110 equals
decimal 6, which is hexadecimal 6.
Therefore, 11010110₂ = D6₁₆.
Binary to hexadecimal conversion table
Use this table to quickly match each four-bit binary value with its hexadecimal equivalent.
| Binary | Decimal | Hexadecimal |
|---|---|---|
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 |
Why convert binary to hexadecimal?
Binary is the fundamental representation used by digital circuits and computers, but long binary strings are difficult for people to read. Hexadecimal provides a compact way to represent the same underlying value: every four binary digits become one hexadecimal digit.
- Programming: Read memory addresses, bit masks and debugging output.
- Networking: Inspect byte values and protocol data.
- Digital electronics: Represent registers and bit patterns.
- Data analysis: Read hexadecimal dumps and encoded bytes.
- Computer science education: Practice conversions between number systems.
Frequently asked questions
How many binary bits does one hexadecimal digit represent?
One hexadecimal digit represents four binary bits, because
\(2^4 = 16\). For example, binary 1111 corresponds
to hexadecimal F.
What is binary 11111111 in hexadecimal?
Binary 11111111 equals hexadecimal FF
and decimal 255.
Can I convert a long binary number?
Yes. This converter processes the digits directly rather than converting the entire input into a JavaScript number. That avoids the usual integer precision limit for long binary strings.
Does adding leading zeros change the value?
No. Leading zeros do not change the numerical value. They can, however, be useful when displaying data in complete bytes or fixed-width fields.
Are hexadecimal letters case-sensitive?
No. Hexadecimal A–F and a–f represent the same values. The converter lets you choose uppercase or lowercase output.