Skip to content

Computer Science · Ch 2 — Encoding Schemes and Number System

Hexadecimal Number System

2.2.4

Hexadecimal Number System

Like octal, hexadecimal numbers are used for a compact representation of binary numbers — and they compress binary even further.

The base-16 system

  • Hexadecimal consists of 16 unique symbols: the digits 0–9 and the letters A–F. It is called the base-16 system.
  • The decimal values 10 through 15 are represented by the letters A through F:
A = 10   B = 11   C = 12   D = 13   E = 14   F = 15
  • Examples of hexadecimal numbers: (23A.05)16, (1C3)16, (619B.A)16.

4 bits per hexadecimal digit

In the hexadecimal system, each alphanumeric digit corresponds to a group of 4 binary digits, because 4 bits are sufficient to represent 16 symbols:

2^4 = 16

So one hexadecimal symbol replaces four bits — a 16-bit binary string becomes just four hexadecimal characters.

The full symbol table

Decimal and binary equivalents of the 16 hexadecimal symbols:

Hex symbolDecimal value4-bit binary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
Table 2.6Decimal and binary equivalent of hexadecimal numbers 0–9, A–F
Hexadecimal SymbolDecimal Value4-bit Binary Number
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100