Binary Number to Hex Number Converter
Convert binary numbers to hexadecimal instantly. Supports any length binary input with real-time validation, step-by-step breakdown, and copy-to-clipboard.
About
Every hex digit maps exactly to a 4-bit binary nibble. This relationship is not approximate. It is a mathematical identity rooted in the fact that 16 = 24. A single misread bit flips a nibble and corrupts memory addresses, color codes, MAC addresses, or firmware payloads. Manual grouping errors account for a disproportionate share of embedded-systems bugs during code review. This converter normalizes your binary input, pads it to the nearest 4-bit boundary, and produces the exact hexadecimal equivalent with a nibble-by-nibble breakdown so you can audit each step.
The tool handles arbitrary-length binary strings. It strips whitespace and validates that every character is 0 or 1 before conversion. Limitation: this is an unsigned integer converter. It does not interpret two's complement sign bits or IEEE 754 floating-point layouts. Pro tip: when working with register dumps, paste the full binary word including leading zeros to preserve alignment in the hex output.
Formulas
The conversion from base-2 to base-16 exploits the identity 16 = 24. Each group of 4 binary digits (a nibble) maps to exactly one hexadecimal digit.
The positional value of each nibble is computed as:
Where bk ∈ {0, 1} is the bit at position k within the nibble, d is the resulting decimal value (0 - 15), and Hi is the hex character for that value. The binary string is right-aligned and zero-padded on the left so its length is a multiple of 4.
Reference Data
| Binary Nibble | Decimal | Hex Digit |
|---|---|---|
| 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 |