Convert Binary to Hexadecimal

Convert binary numbers to hexadecimal by grouping bits into nibbles. Learn the 4-bit-to-hex mapping table and practice with step-by-step worked examples.

Binary (Base 2)Hexadecimal (Base 16)Conversion

Detailed Explanation

Binary-to-hex conversion is one of the simplest and most useful conversions in computing because each hexadecimal digit corresponds to exactly 4 binary bits (a nibble). This relationship exists because 2⁴ = 16.

Step-by-step example — converting 11010110101 to hex:

  1. Pad with leading zeros so the total number of bits is a multiple of 4: 0110 1011 0101
  2. Group into 4-bit nibbles from right to left: 0110 | 1011 | 0101
  3. Convert each nibble using the lookup table: 0110=6, 1011=B, 0101=5
  4. Combine: 0x6B5

So 11010110101₂ = 0x6B5.

The complete 4-bit to hex lookup table:

Binary Hex Binary Hex
0000 0 1000 8
0001 1 1001 9
0010 2 1010 A
0011 3 1011 B
0100 4 1100 C
0101 5 1101 D
0110 6 1110 E
0111 7 1111 F

Memorizing this table is one of the most valuable things you can do as a programmer or engineer. Once you know it, you can mentally convert between binary and hex almost instantly.

Why this matters:

Hex is the standard way to display binary data in a compact, readable form. A 32-bit value like 11111111111111111111111111111111 is nearly impossible to read, but its hex equivalent FFFFFFFF is instantly recognizable. Memory addresses, MAC addresses, hash values, and color codes all use hex for this reason. Mastering binary-to-hex conversion makes debugging, reverse engineering, and hardware work significantly faster.

Use Case

Hardware engineers convert binary register dumps to hex when debugging microcontroller firmware, since hex provides a compact and readable representation of multi-byte values.

Try It — Number Base Converter

Open full tool