The octal system, while less common than binary or hexadecimal in general programming, plays a crucial role in specific areas like Unix file permissions. It uses the number 8 as its base to denote the numbers. Also, it remains important in specific areas, such as setting file permissions in Unix/Linux systems (e.g., chmod 755).
The numbers in the octal system are from 0 to 7, and the base is 8 (like binary, where the base is 2). We can convert octal numbers to decimal by using powers of 8, just like we use powers of 2 to convert binary numbers into decimal numbers.
Before we proceed to the examples, let us first revise the concept of data storage (just to refresh the memory):
| Unit | Abbreviation | Standard | Size (Bytes) |
|---|---|---|---|
| Bit | b | Binary | 1/8 |
| Byte | B | Binary | 1 |
| Kilobyte | kB | Decimal | 1,000 |
| Kibibyte | KiB | Binary | 1,024 |
| Megabyte | MB | Decimal | 1,000,000 |
| Mebibyte | MiB | Binary | 1,048,576 |
| Gigabyte | GB | Decimal | 1,000,000,000 |
| Gibibyte | GiB | Binary | 1,073,741,824 |
Now, we will see how to convert octal numbers into decimal numbers (the numbers that we use on a regular basis):
Before that, gain familiarity with the power tower of 8.
Example 1.1: Convert into a decimal number.
Example 1.2: Convert into a decimal number.
Just like we saw how to convert octal numbers into decimal numbers, we will now understand how to convert decimal numbers into octal numbers by taking some examples.
Example 2.1: Convert into an octal number.
- Divide 3425 by 8.
- Record the remainder (it will be between 0 and 7, including both).
- Take the quotient (the result of the division) and divide it by 8 again.
- Repeat until the quotient is 0.
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 3425 ÷ 8 | 428 | 1 |
| 2 | 428 ÷ 8 | 53 | 4 |
| 3 | 53 ÷ 8 | 6 | 5 |
| 4 | 6 ÷ 8 | 0 | 6 |
Now, read the remainders from the bottom to the top (from the last remainder to the first).
Bottom to top: $$ {(3425)_{10} = (6541)_8} $$
Example 2.2: Convert into an octal number.
- Divide 1000 by 8.
- Record the remainder (it will be between 0 and 7, including both).
- Take the quotient (the result of the division) and divide it by 8 again.
- Repeat until the quotient is 0.
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 1000 ÷ 8 | 125 | 0 |
| 2 | 125 ÷ 8 | 15 | 5 |
| 3 | 15 ÷ 8 | 1 | 7 |
| 4 | 1 ÷ 8 | 0 | 1 |
Now, read the remainders from the bottom to the top (from the last remainder to the first).
Bottom to top: $$ {(1000)_{10} = (1750)_8} $$
Here it is. The basic process is to understand the octal number system. Practice it, Keep learning, stay curious, and All the Best!
Discover more from universeunlocks.in
Subscribe to get the latest posts sent to your email.


