The octal or base-8 numbering system may be used as a condensed representation of a binary number, since each octal digit is equivalent to three binary digits.

The main features of the octal numbering system are that:-

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

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

## Converting between Binary and Octal

The principle of number base conversion between binary and octal relies on the fact that a single octal digit has the same range as a 3-bit binary number. Hence starting at the right hand side, groups of three bits may be converted into a single octal digit or vice versa, as shown in the following table.

Bit 2
(4)
Bit 1
(2)
Bit 0
(1)
Octal Value
0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7

#### Converting Octal to Binary

In octal to binary conversion, each octal digit is replaced by an equivalent group of 3 binary digits. The following example converts 376128 to binary form, giving a result of 011 1111 1000 10102.

#### Converting Binary to Octal

In binary to octal conversion the binary number is first arranged into groups of 3 binary digits, starting at the right-hand side, each of which is replaced with the appropriate octal digit. This approach is demonstrated by the following example, which converts the binary number 0110 1010 0010 00112 to octal form, giving a result of 650438.

See the Numbering Systems Problems page for additional practice activities. Windows users may check their results by using the Windows Calculator in programmer’s view.