Binary to Hexadecimal Calculator
The binary to hexadecimal calculator converts base-2 values to base-16 and can also expand hexadecimal digits back to binary. It is handy for programming, digital logic, memory addresses, bit masks, and understanding color or data representations.
How to use this calculator
Choose Binary to hexadecimal to enter a binary number containing only zeros and ones. The current form accepts up to 16 bits. Choose Hexadecimal to binary to select one to four hex digits from 0 through F. The result shows the converted value and a note about grouping.
How it works
Binary maps cleanly to hex because each hexadecimal digit represents four bits. Start grouping from the right:
| Binary group | Hex digit |
|---|---|
0000 | 0 |
1010 | A |
1111 | F |
If the leftmost group is short, pad it with leading zeros for conversion. Binary 11010110 becomes 1101 0110, which converts to D6. Hex A5 expands to 1010 0101.
Practical notes
Keep the intended bit width when it matters. The same visible hex value can mean different things in signed, unsigned, or fixed-width contexts. For broader math conversions, see the scientific notation calculator, random number generator, and color format converter calculator.
Common mistakes
- Grouping bits from the left instead of the right.
- Forgetting left padding for a short first group.
- Mixing decimal 10 with hex digit A.