- Decimal Numbers Definition: Decimal numbers use base 10 and include digits from 0 to 9.
- Octal Numbers Definition: Octal numbers use base 8 and include digits from 0 to 7.
- Conversion Process: To convert decimal to octal, divide by 8 repeatedly and write remainders in reverse order.
- Practical Example: Converting 130 in decimal results in 202 in octal.
- Importance of Octal: Octal numbers are useful in Unix file permissions, IP address representation, and ASCII encoding.
A decimal number uses base 10 and has ten digits: 0 through 9. Each place value counts a power of ten, so 123 means one hundred, two tens and three units.
An octal number uses base 8 and has eight digits: 0 through 7. Its place values count powers of eight instead, so identical digits carry different amounts depending on the base.
In early computing, the octal number system was popular because it made long binary numbers shorter: every group of three binary digits maps to exactly one octal digit. For example, 101110 in binary is 56 in octal because 101 is 5 and 110 is 6.
Hexadecimal numbers have largely replaced octal in modern computers. Hexadecimal works in base 16 with sixteen possible digits: 0 through 9 plus A through F, where each digit maps four binary bits.
To convert a decimal number to an octal number, follow these steps:
Step 1: Divide the decimal number by 8
The first step divides the decimal number by 8. Write down both results: the quotient is the whole-number part of the result, and the remainder is the amount left over.
To convert 130, start by dividing it by 8:
130 / 8 = 16 with a remainder of 2
Step 2: Repeat step 1 with the quotient
The next step repeats step 1 using the previous quotient: divide it by 8 again and write down the new quotient and remainder.
Using the quotient from step 1:
16 / 8 = 2 with a remainder of 0
Step 3: Continue until the quotient is zero
Keep repeating this process until the quotient reaches zero. Each division produces one more remainder, and each remainder becomes one digit of the octal answer.
For example:
2 / 8 = 0 with a remainder of 2
Step 4: Write down the remainder in reverse order
The final step writes all remainders in reverse order: the last remainder found becomes the leading digit, and the sequence that results is the octal equivalent of the decimal number.
For example:
The remainders from steps 1-3 are:
- Step 1: Remainder = 2
- Step 2: Remainder = 0
- Step 3: Remainder = 2
Writing them in reverse order gives:
202
Therefore,
130<sub>10</sub> = 202<sub>8</sub>
Example: Convert decimal to octal
Let’s apply the same method to 35631<sub>10</sub>, one division at a time.
We start by dividing it by 8:
35631 / 8 = 4453 with a remainder of 7
We repeat with the quotient:
4453 / 8 = 556 with a remainder of 5
We repeat again:
556 / 8 = 69 with a remainder of 4
And again:
69 / 8 = 8 with a remainder of 5
And one more time:
8 / 8 = 1 with a remainder of 0
One final division brings the quotient to zero: 1 divided by 8 equals 0 with a remainder of 1.
We write down all the remainders in reverse order:
105457
Therefore,
35631<sub>10</sub> = 105457<sub>8</sub>
Decimal to Octal Conversion Table
This table lists some common decimal numbers and their octal equivalents:
| Decimal | Octal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 10 |
| 9 | 11 |
| 10 | 12 |
| 11 | 13 |
| 12 | 14 |
| 13 | 15 |
| 14 | 16 |
| 15 | 17 |
| 16 | 20 |
Use the table as a quick reference or check your answers with our decimal-to-octal converter.
Octal to Decimal Conversion
Converting an octal number to a decimal number reverses the process: multiply each digit of the octal number by its corresponding power of eight and add up the products.
For example, take the octal number 123<sub>8</sub>. To convert it to decimal:
123<sub>8</sub> = (1 * (8<sup>2</sup>)) + (2 * (8<sup>1</sup>)) + (3 * (8<sup>0</sup>))
= (1 * (64)) + (2 * (8)) + (3 * (1))
= (64) + (16) + (3)
= 83<sub>10</sub>
You can also use our octal-to-decimal converter for quick conversions.
Why Learn Decimal to Octal Conversion?
Everyday counting runs on decimal numbers, while most programming relies on binary or hexadecimal.
Even so, a few systems still depend on octal numbers. For example:
- Unix-like operating systems store file permissions in octal. Each file has three permission sets for different users: owner, group and others. Each set holds three bits for read, write and execute. Those bits fit in one octal digit from 0 to 7.
- For example, 644 means that the owner can read and write the file, the group can read it and others can read it too.
- Some applications accept IP addresses written in octal. An IP address identifies a device on a network with four numbers from 0 to 255 separated by dots. Each number fits in three octal digits from 000 to 377.
- For example, 192.168.0.1 can be written as 300.250.000.001 in octal.
- Programming languages represent character codes through octal escape sequences: a backslash followed by up to three octal digits from 000 to 177. That range covers every ASCII value from 0 to 127.
- For example, \141 represents the letter ‘a’, and \176 represents the tilde ‘~’.
These are some places where you might encounter octal numbers in computing. Knowing how to convert between decimal and octal helps you read those settings with confidence.
Summary
In this article, you learned what decimal and octal numbers are and how to convert between them: repeated division by 8 produces the octal digits, while multiplying each octal digit by its power of eight recovers the decimal value.
You also saw where octal still appears today and how its three-bit grouping connects it to binary, while hexadecimal groups four bits at a time.





