Octal

Anonymous contributor's avatar
Anonymous contributor
Published Mar 7, 2023
Contribute to Docs

The octal number system is a base-8 number system that uses digits from 0-7 to represent any number. Octal is a number system similar to other number systems like binary and hexadecimal.

Octal was often used because machines were based on 12, 24, or 36 bits. In contrast, binary or hexadecimal are commonly used in modern technologies, especially with 16, 32, or 64-bit machines. The octal number system has an advantage over the hexadecimal system in that characters from the alphabet are not used to express a number in octal.

  • Start your programming journey with an introduction to the world of code and basic concepts.
    • Includes 5 Courses
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

Example

octal decimal
0 0
1 1
2 2
3 3
7 7
10 8
11 9
12 10
20 16
40 32
100 64

Each digit corresponds to a power of 8. The last digit (decimal 0-7) is 80, equalling 1. The one in front of it is 81, and so on. So each digit represents the figure times 8 to the power of its position. An octal number is converted to decimal like so (using octal 125 as an example):

125 = 1 * 82 + 2 * 81 + 5 * 80 = 64 + 16 + 5 = 85

All contributors

Contribute to Docs

Learn General on Codecademy

  • Start your programming journey with an introduction to the world of code and basic concepts.
    • Includes 5 Courses
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours