The octal numeral system is a base 8 numeral system. It uses the numerals 0 through 7. The system is similar to binary (base 2) and hexadecimal (base 16). Octal numerals are written using the letter o before the numeral, for example, o04 or o1242. Octal numbers are also sometimes written with a small 8 to the lower right, as in 1242_{8}.
At one time, the octal system was used mainly for work with computers. It provided an easier way to work with binary numbers. As computers changed from using 24-bit systems to 32- and 64-bit systems, hexadecimal replaced octal for most uses. Certain groups, for example, Native Americans using the Yuki language in California and the Pamean languages^{[1]} in Mexico, also use an octal numbering system. They do this because when they count, they use the spaces between their fingers instead of counting the actual fingers.
The octal numeral system uses a "three-bit" binary coding. Each digit in an octal numeral is the same as three digits in a binary numeral. The grouping of the binary digits is done from right to left. The first three binary digits from the right are grouped into the last part of the octal numeral, then the next three digits form the next to the last part of the numeral.
Octal | Binary | 1 | 001 | 2 | 010 | 3 | 011 | 4 | 100 | 5 | 101 | 6 | 110 | 7 | 111 | 10 | 001 000 | | Octal | Binary | 11 | 001 001 | 12 | 001 010 | 36 | 011 110 | 45 | 100 101 | 53 | 101 011 | 64 | 110 100 | 100 | 001 000 000 | 357 | 011 101 111 | | Binary | Groupings | Octal | 11 | | | | 011 | 3 | 010111 | | | 010 | 111 | 27 | 101000110 | | 101 | 000 | 110 | 506 | 01011010101 | 001 | 011 | 010 | 101 | 1325 | |
In the decimal system (base 10), each digit in octal is equal to that digit multiplied by the exponent of 8 that is equal to its location minus one.
| Location |
6 | 5 | 4 | 3 | 2 | 1 |
Value | 32768 (8^{5}) | 4096 (8^{4}) | 512 (8^{3}) | 64 (8^{2}) | 8(8^{1}) | 1 (8^{0}) |
Example: o3425 to decimal
| Octal | | Decimal | o3425 | = | ( 5 × 1 ) | + | ( 2 × 8) | + | ( 4 × 64 ) | + | ( 3 × 512) | = | 5 | + | 16 | + | 256 | + | 1536 | o3425 | = | 1813 | |
Octal is similar to hexadecimal because they are both easily converted to binary. Where octal is equal to three-digit binary, hexadecimal is equal to four-digit binary. Where octal numerals start with the letter "o", hexadecimal numerals end with the letter "h". The easiest way to convert from one to the other is to convert to binary and then to the other system.
Octal | Binary | Hexadecimal |
three digit | four digit |
o4 | | | | | 100 | | | | 0100 | 04h |
o15 | | | | 001 | 101 | | | | 1101 | 0Dh |
o306 | | | 011 | 000 | 110 | | | 1100 | 0110 | C6h |
o54253 | 101 | 100 | 010 | 101 | 011 | 0101 | 1000 | 1010 | 1011 | 58ABh |