Select Page

The hexadecimal or base-16 numbering system is commonly used as a condensed representation of a binary number, since each hexadecimal digit is equivalent to four binary digits.

The main characteristics of the hexadecimal numbering system are that:-

• each digit varies in the range 0 to 15,
• moving to the left, each digit is worth sixteen times as much as the digit immediately to its right.

The octal or base-8 numbering system is an alternative to hexadecimal, in which each octal character is equivalent to three binary digits.

A single hexadecimal digit may take any value between 0 and 15. Numbers 0–9 are used as in the decimal system, while values in the range 10–15 are represented by letters of the alphabet A, B, C, D, E and F, as shown in the following table.

Bit 3
(8)
Bit 2
(4)
Bit 1
(2)
Bit 0
(1)
0 0 0 0 0
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9
1 0 1 0 A
1 0 1 1 B
1 1 0 0 C
1 1 0 1 D
1 1 1 0 E
1 1 1 1 F

## Converting Between Binary and Hexadecimal

Conversion between binary and hexadecimal is based on swapping groups of 4-bits with the equivalent hexadecimal digit. Unfortunately, there is no easy way to remember the associated 4 bit binary codes for the letters A to F, other than regular practice. However, the above table may easily be drawn from first principles, if required.