Mathwords logoReference LibraryMathwords

Hexadecimal

Hexadecimal is a base-16 number system that uses sixteen symbols: the digits 0 through 9 and the letters A through F, where A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. It is widely used in computing because it provides a compact way to represent binary data.

Hexadecimal (often abbreviated "hex") is a positional numeral system with a radix of 16. Each digit position represents a power of 16, so a hexadecimal number dndn1d1d0d_n d_{n-1} \ldots d_1 d_0 has the decimal value i=0ndi×16i\sum_{i=0}^{n} d_i \times 16^i. Because 16=2416 = 2^4, each hexadecimal digit corresponds exactly to a group of four binary digits (bits), making hex a convenient shorthand for binary values.

Key Formula

Value=dn×16n+dn1×16n1++d1×161+d0×160\text{Value} = d_n \times 16^n + d_{n-1} \times 16^{n-1} + \cdots + d_1 \times 16^1 + d_0 \times 16^0
Where:
  • did_i = the hexadecimal digit at position i (0–9 or A–F)
  • 16i16^i = the place value at position i
  • nn = the position of the leftmost digit (counting from 0)

Worked Example

Problem: Convert the hexadecimal number 2A3 to decimal.
Step 1: Identify each digit and its position. From right to left: 3 is at position 0, A is at position 1, and 2 is at position 2.
Step 2: Replace any letters with their decimal equivalents. A = 10.
Step 3: Multiply each digit by the corresponding power of 16.
2×162+10×161+3×1602 \times 16^2 + 10 \times 16^1 + 3 \times 16^0
Step 4: Calculate each term and add them together.
2×256+10×16+3×1=512+160+3=6752 \times 256 + 10 \times 16 + 3 \times 1 = 512 + 160 + 3 = 675
Answer: The hexadecimal number 2A3 is equal to 675 in decimal.

Why It Matters

Hexadecimal is everywhere in computing. Colors on websites are specified in hex (like #FF5733), memory addresses are written in hex, and programmers use it constantly because it compresses long binary strings into something far more readable. A single hex digit replaces four binary digits, so a byte (8 bits) can be neatly written as just two hex characters instead of eight 0s and 1s.

Common Mistakes

Mistake: Treating hex digits A–F as separate letters instead of numbers
Correction: Remember that A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. These are single-digit values in base 16, not placeholders.
Mistake: Using powers of 10 instead of powers of 16 when converting
Correction: Hexadecimal is base 16, so each position represents a power of 16 (1, 16, 256, 4096, …), not a power of 10.

Related Terms

  • BaseHexadecimal is the base-16 number system
  • DigitHex uses 16 distinct digit symbols