0.4.5 The Hexadecimal Number System

Hexadecimal Is Base 16

The hexadecimal number system is a base-16 number system.

It needs sixteen single-digit symbols.

The first ten are familiar:

Plain text
0 1 2 3 4 5 6 7 8 9

Hexadecimal then uses letters for the next six digit values:

Plain text
A B C D E F

The values are:

Hex digit Decimal value
A 10
B 11
C 12
D 13
E 14
F 15

After F, hexadecimal moves to another position:

Plain text
10₁₆

which represents decimal 16.

Hexadecimal Place Values Grow by Powers of 16

Starting from the right:

Plain text
1, 16, 256, 4096, ...

These are powers of 16:

Plain text
16^0 = 1
16^1 = 16
16^2 = 256

This follows the same positional-number-system idea you already used in decimal and binary.

The base changes.

The place-value logic does not.

Example: 2A

Consider:

Plain text
2A₁₆

The left digit is in the 16s place.

The right digit is in the 1s place.

A represents decimal 10.

Therefore:

Plain text
2 × 16 = 32
A × 1 = 10

Add them:

Plain text
32 + 10 = 42

So:

Plain text
2A₁₆ = 42₁₀

Example: 3F

3F₁₆ has:

Plain text
3 × 16 = 48
F = 15

Therefore:

Plain text
48 + 15 = 63

So:

Plain text
3F₁₆ = 63₁₀

Hex Digits Are Values, Not Letters in a Word

In hexadecimal:

A

means the digit value ten.

F

means the digit value fifteen.

The letters are used because base 16 needs more single-digit symbols than decimal provides.

Treat A through F as hexadecimal digits when they appear in a hexadecimal value.

How Hexadecimal Values Are Marked

Different technical contexts use different ways to show that a value is hexadecimal.

You may see notation such as:

Plain text
2A₁₆

or, in many programming-related contexts:

Plain text
0x2A

The notation helps prevent confusion with decimal.

For this module, focus on understanding the number system itself rather than memorizing every notation convention.

Hexadecimal Is More Compact Than Binary

The decimal value 15 is binary:

Plain text
1111

but hexadecimal:

Plain text
F

The decimal value 255 is binary:

Plain text
11111111

but hexadecimal:

Plain text
FF

Hexadecimal can represent long binary patterns with fewer written symbols.

That makes it useful when people need to read or write values closely connected to binary information.

The Same Quantity Has Several Representations

The quantity fifteen can be written as:

Plain text
15₁₀
1111₂
F₁₆

The symbols differ because the bases differ.

The represented quantity is the same.

This is the central number-system idea in the module:

value and representation are related, but they are not the same thing.

Hexadecimal Connects Naturally to Four Bits

One hexadecimal digit has sixteen possible values:

Plain text
0 through F

Four binary bits have sixteen possible patterns:

Plain text
0000 through 1111

That one-to-one match is extremely useful.

It means a four-bit binary pattern can be represented by exactly one hexadecimal digit.

The next activity develops that connection directly.