Understanding Octal: How to Convert Base-8 to Decimal
Why does the number 8 not exist in Octal? Learn the math behind the Base-8 numbering system used in UNIX file permissions and early computing.

Introduction: A Number System Hiding in Plain Sight
Instantly translate complex Base-8 strings into readable numbers using our Octal to Decimal Converter, or read on to understand the historical mathematics of the Octal system.
We are highly familiar with Base-10 (Decimal) because we have ten fingers. We use it for prices, ages, distances, and almost every everyday count.
We are familiar with Base-2 (Binary) and Base-16 (Hexadecimal) because they are the foundation of modern computing. Software, memory addresses, and color codes rely on them daily.
But what about Base-8 (Octal)?
While less common today, the Octal numbering system was a critical tool in early computing. It is still heavily used today by Linux system administrators to set file permissions.
This guide explains how Octal works, how to convert it by hand in both directions, and how to spot the mistakes that cause most errors.
The Rules of Base-8
In the Base-10 decimal system, you count from 0 to 9. When you run out of digits, you carry a 1 to create the number 10.
In the Base-8 Octal system, you only have eight digits: 0, 1, 2, 3, 4, 5, 6, and 7.
The numbers 8 and 9 literally do not exist in Octal math.
That single rule explains almost everything else in this article. If you see an 8 or a 9 in a string, that string cannot be a valid Octal number.
Let's count from zero in Octal:
0, 1, 2, 3, 4, 5, 6, 7...
What comes next? You ran out of digits. You must carry a 1.
The next number is 10 (which mathematically equals 8 in decimal).
Counting further helps make the pattern feel natural:
- Octal 10 = decimal 8
- Octal 11 = decimal 9
- Octal 12 = decimal 10
- Octal 17 = decimal 15
- Octal 20 = decimal 16
- Octal 100 = decimal 64
Notice that Octal numbers grow faster on the page than decimal numbers. That is expected, because each new place is worth more than the last digit suggests to decimal eyes.
To avoid confusion, programmers often write Octal with a leading zero, such as 017, or with a prefix in code. Context matters, so always check which base a number uses.
Enter your own numbers and see the result instantly — free, no signup.
The Positional Method (Powers of 8)
To convert an Octal number back into a standard human number, you use the exact same positional logic used in Hexadecimal, but you use powers of 8 instead of 16.
Reading from right to left, the columns in an Octal number are:
- Position 1:
8^0= The 1s column - Position 2:
8^1= The 8s column - Position 3:
8^2= The 64s column - Position 4:
8^3= The 512s column - Position 5:
8^4= The 4096s column
The rule is the same as in decimal. Multiply each digit by the value of its column, then add all the results together.
Decimal works identically, except its columns are powers of 10: 1, 10, 100, and 1000. Only the base changes. The method does not.
Example: Converting Octal 142
Convert the Octal number 142 to decimal.
- Right digit (2):
2 × 1 = 2 - Middle digit (4):
4 × 8 = 32 - Left digit (1):
1 × 64 = 64 - Add them together:
2 + 32 + 64 = 98.
The Octal number 142 equals exactly 98 in decimal.
Why This Method Always Works
Every positional system breaks a number into a sum of digit-times-place terms. Octal is not a trick or a shortcut. It is decimal's own logic with a smaller digit set.
Once you trust that idea, longer Octal numbers stop looking intimidating. You simply add one more power of 8 for each extra digit on the left.
More Worked Examples: Octal to Decimal
Working through several examples is the fastest way to build confidence. Each example below follows the same three steps: label the places, multiply, then add.
Example: Octal 17 to Decimal
The number 17 has two digits, so it uses the 8s column and the 1s column.
- Left digit (1):
1 × 8 = 8 - Right digit (7):
7 × 1 = 7 - Add them together:
8 + 7 = 15.
Octal 17 equals 15 in decimal.
Example: Octal 25 to Decimal
Again, there are two digits, so the places are 8 and 1.
- Left digit (2):
2 × 8 = 16 - Right digit (5):
5 × 1 = 5 - Add them together:
16 + 5 = 21.
Octal 25 equals 21 in decimal.
Example: Octal 345 to Decimal
This three-digit number uses the 64s, 8s, and 1s columns.
- Left digit (3):
3 × 64 = 192 - Middle digit (4):
4 × 8 = 32 - Right digit (5):
5 × 1 = 5 - Add them together:
192 + 32 + 5 = 229.
Octal 345 equals 229 in decimal.
Example: Octal 777 to Decimal
This example shows the largest three-digit Octal number.
- Left digit (7):
7 × 64 = 448 - Middle digit (7):
7 × 8 = 56 - Right digit (7):
7 × 1 = 7 - Add them together:
448 + 56 + 7 = 511.
Octal 777 equals 511 in decimal. The next Octal number after 777 is 1000, which equals 512 in decimal.
Quick Check Table
Use this table to test yourself before checking the answers in the text above.
| Octal | Decimal | How to check |
|---|---|---|
| 10 | 8 | 1 × 8 + 0 × 1 |
| 100 | 64 | 1 × 64 + 0 × 8 + 0 × 1 |
| 123 | 83 | 1 × 64 + 2 × 8 + 3 × 1 |
| 271 | 185 | 2 × 64 + 7 × 8 + 1 × 1 |
| 377 | 255 | 3 × 64 + 7 × 8 + 7 × 1 |
| 777 | 511 | 7 × 64 + 7 × 8 + 7 × 1 |
Converting Decimal to Octal: The Division Method
Converting in the reverse direction uses repeated division by 8. You divide, record each remainder, and then read the remainders from bottom to top.
If you need to practice this direction with instant checking, try our Decimal to Octal Converter after working one example by hand.
Example: Decimal 98 to Octal
Start with 98 and keep dividing by 8 until the quotient reaches zero.
98 ÷ 8 = 12remainder 212 ÷ 8 = 1remainder 41 ÷ 8 = 0remainder 1
Read the remainders upward: 1, 4, 2. So decimal 98 equals Octal 142, which matches the earlier example.
Example: Decimal 100 to Octal
Apply the same steps to 100.
100 ÷ 8 = 12remainder 412 ÷ 8 = 1remainder 41 ÷ 8 = 0remainder 1
Reading upward gives 144. Decimal 100 equals Octal 144.
Example: Decimal 83 to Octal
This example reverses the Octal 123 conversion from the table above.
83 ÷ 8 = 10remainder 310 ÷ 8 = 1remainder 21 ÷ 8 = 0remainder 1
Reading upward gives 123. Decimal 83 equals Octal 123.
Example: Decimal 255 to Octal
Larger numbers need the same method, just with one extra division at the start.
255 ÷ 8 = 31remainder 731 ÷ 8 = 3remainder 73 ÷ 8 = 0remainder 3
Reading upward gives 377. Decimal 255 equals Octal 377, a value you will meet again in computing contexts.
How to Check Your Answer
Always convert your Octal result back to decimal using the positional method. If you return to your starting number, both conversions are consistent.
This round-trip check takes seconds and catches the most common error in the division method, which is reading the remainders in the wrong order.
Octal and Binary: The 3-Bit Grouping Shortcut
Octal and binary are closely linked. A single Octal digit can be perfectly represented by exactly three bits of binary, from 000 to 111.
That relationship gives you a fast shortcut. You do not need decimal as a middle step when moving between Octal and binary.
Here is the complete mapping. There are only eight rows to learn.
| Octal digit | Binary (3 bits) |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
Converting Binary to Octal
Start on the right and split the binary string into groups of three bits. If the leftmost group has fewer than three bits, add leading zeros to complete it.
Then replace each group with its Octal digit from the table above.
For example, take the binary string 101011000111:
- Group from the right:
101 | 011 | 000 | 111 - Convert each group:
101 = 5,011 = 3,000 = 0,111 = 7 - Read the digits in order: 5307
So binary 101011000111 equals Octal 5307, which equals 2759 in decimal.
Converting Octal to Binary
Reverse the process. Replace each Octal digit with its exact three-bit binary group, then join the groups together.
For example, Octal 755 becomes:
7 = 1115 = 1015 = 101
Joined together, that is binary 111101101. As a plain number, Octal 755 equals 493 in decimal.
Similarly, Octal 644 becomes 110 | 100 | 100, or binary 110100100, which equals 420 in decimal.
Keep the leading zeros inside each group. Dropping a zero in the middle, for example writing 1 as 1 instead of 001, breaks every group that follows it.
If you want to verify the decimal value of a binary string while you practice, our Binary to Decimal Converter provides a quick independent check.
Octal vs Binary vs Decimal vs Hexadecimal
All four systems in this table use the same positional idea. They differ only in their base, their digit set, and how compact they look.
| Feature | Binary | Octal | Decimal | Hexadecimal |
|---|---|---|---|---|
| Base | 2 | 8 | 10 | 16 |
| Digits used | 0–1 | 0–7 | 0–9 | 0–9, A–F |
| Bits per digit | 1 | 3 | Not fixed | 4 |
| Common use | Machine code | File permissions, legacy systems | Everyday counting | Memory, colors, modern code |
The same value looks very different in each system. Comparing a few values side by side makes the trade-off clear.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 511 | 111111111 | 777 | 1FF |
Binary is exact but long. Decimal is familiar but does not line up neatly with bits. Octal and hexadecimal are compromises that compress binary into shorter strings.
Hexadecimal won out for modern byte-based systems because one hex digit equals four bits, and two hex digits equal one full 8-bit byte.
Octal still wins where values naturally fall into groups of three bits. File permissions are the best-known surviving example, as the next sections show.
Why Did Programmers Use Octal?
In the 1960s and 70s, computers did not use 8-bit bytes or 64-bit processors. Early mainframe computers (like the PDP-8) used 12-bit, 24-bit, or 36-bit words.
Because these numbers are perfectly divisible by 3, programmers realized they could perfectly compress long strings of binary into Octal.
- A single Octal digit (0-7) can be perfectly represented by exactly three bits of binary (000 to 111).
- This allowed a programmer to look at a massive 12-bit binary string (
101011000111) and instantly read it as four simple Octal numbers (5307).
When the world eventually standardized on the 8-bit byte (which is not divisible by 3), Octal was largely replaced by Hexadecimal (Base-16), because a Hex digit perfectly maps to exactly four bits.
That history explains Octal's present role. It did not disappear because it was wrong. It faded because hardware changed around it, and hex fit the new hardware better.
Octal remains in specifications, permission systems, and older code that still runs today. Reading it fluently is therefore a practical skill, not only a historical curiosity.
Octal in Modern Linux (chmod)
If you have ever managed a web server or used a Linux terminal, you have probably typed a command like chmod 755 filename.txt.
You just used Octal!
In UNIX operating systems, file permissions are divided into three groups: Owner, Group, and Public. Each group has three binary switches: Read (4), Write (2), and Execute (1).
Because 4 + 2 + 1 = 7, a single Octal digit is the perfect mathematical container to represent the permissions for a group.
- 7 (4+2+1): The user can Read, Write, and Execute.
- 5 (4+0+1): The user can Read and Execute, but cannot Write.
So, the Octal code 755 tells the computer: The Owner has full power (7), the Group can only read and execute (5), and the Public can only read and execute (5).
The Permission Values to Memorize
Each permission digit is a small sum. Only these combinations appear in normal use.
| Digit | Sum | Letters | Meaning |
|---|---|---|---|
| 7 | 4+2+1 | rwx | Read, write, and execute |
| 6 | 4+2+0 | rw- | Read and write only |
| 5 | 4+0+1 | r-x | Read and execute only |
| 4 | 4+0+0 | r-- | Read only |
| 0 | 0+0+0 | --- | No access |
The letters come from the output of commands that list permissions. The digit and the letters describe the same three switches, just in different notation.
Worked Example: chmod 755
Read the three digits from left to right as Owner, Group, and Public.
- Owner = 7 =
4+2+1= rwx - Group = 5 =
4+0+1= r-x - Public = 5 =
4+0+1= r-x
In full, 755 is rwxr-xr-x. The owner can change and run the file, while everyone else can run and read it but not change it.
This setting is common for folders and programs that need to be run by others, without letting others modify them.
Worked Example: chmod 644
Now decode 644 digit by digit.
- Owner = 6 =
4+2+0= rw- - Group = 4 =
4+0+0= r-- - Public = 4 =
4+0+0= r--
In full, 644 is rw-r--r--. The owner can edit the file, while everyone else can only read it.
This is a common setting for ordinary documents and web files that should be public to view but not public to edit.
Worked Example: chmod 777
Finally, decode 777.
- Owner = 7 =
4+2+1= rwx - Group = 7 =
4+2+1= rwx - Public = 7 =
4+2+1= rwx
In full, 777 is rwxrwxrwx. Every user can read, change, and run the file.
That openness is rarely what you actually want on a shared system. Use 777 only when you fully understand why a file needs it, and prefer a narrower setting otherwise.
Two More Settings Worth Knowing
Private files often use 600, which is rw-------. The owner can read and write, and the group and public get no access at all.
Shared read-only handovers sometimes use 640, which is rw-r-----. The owner can read and write, the group can read, and the public gets nothing.
Learning 755, 644, and 600 alone covers a large share of the permission codes you will meet in everyday server work.
An Important Distinction About chmod Numbers
In chmod, the three digits are read separately as three permission groups. Do not convert 755 as a single quantity when you are setting permissions.
Coincidentally, Octal 755 as a plain number equals 493 in decimal and 111101101 in binary. That fact is useful for conversion practice, but it is not how chmod interprets the code.
Keeping those two readings separate prevents a very common source of confusion for beginners.
Common Mistakes When Converting Octal
Most Octal errors are not math errors. They are reading errors, and each one below has a simple check that prevents it.
Mistake 1: Using the Digits 8 or 9
A valid Octal number never contains 8 or 9. If either digit appears, the number is in another base, or it was copied incorrectly.
Mistake 2: Reading Octal as Decimal
Octal 10 is not ten. It is 8 in decimal. Octal 20 is not twenty. It is 16 in decimal.
The fix is to ask about the base before doing any arithmetic, especially when a number appears in code, a log, or a permission setting.
Mistake 3: Reading Remainders in the Wrong Order
In decimal-to-Octal division, the first remainder you find is the rightmost Octal digit, not the leftmost one.
Always read the remainders from the last division up to the first. Then verify by converting your answer back to decimal.
Mistake 4: Dropping Zeros in Binary Groups
When you expand Octal to binary, every digit must become exactly three bits. Octal 101, for example, needs the middle zero kept as 000.
If you shorten a middle group, every bit after it shifts position, and the final binary value is wrong even though it may look plausible.
Mistake 5: Confusing Octal With Hexadecimal
Octal uses only digits 0 to 7, while hexadecimal uses 0 to 9 plus A to F, and groups binary by four bits instead of three.
A letter in the string is an immediate sign that you are not looking at Octal. Treat that as a prompt to recheck the intended base.
Mistake 6: Misreading chmod as One Number
As noted above, chmod 644 is three separate permission digits, not a single decimal-style quantity to convert in one step.
Decode each digit on its own against the 4-2-1 values, in Owner, Group, Public order, every time.
FAQ
Can I convert Octal directly to Hexadecimal? While you can, it is mathematically grueling. The most reliable method is a two-step process: First, convert the Octal number into Decimal (or Binary). Second, convert that new number into Hexadecimal.
Going through binary is often fastest in practice. Expand each Octal digit to three bits, regroup the bits in fours from the right, then convert each group of four to a hex digit.
How do I know if a number is Octal or decimal?
Look for context, such as a leading zero, a base label, a chmod command, or documentation that names the base. Without context, the digits alone may not tell you, since 142 could exist in either system with different values.
What is the largest digit and place value I should memorize? Memorize digits 0 to 7 and the places 1, 8, 64, and 512. Those four places handle most textbook and permission-related examples. For longer numbers, continue the pattern by multiplying the last place by 8 each time.
Why does chmod not use decimal numbers like 10 for a permission? Because each permission group needs to encode three separate yes-or-no switches. A single Octal digit from 0 to 7 maps exactly onto those three switches through the values 4, 2, and 1, which decimal digits do not do as cleanly.
Is Octal still worth learning if I mainly use hex? Yes, if you work with Linux permissions, legacy systems, or low-level code. You will meet Octal in those settings whether you study it or not, and the conversion method takes only a few minutes to learn well.
Conclusion: A Small System With a Lasting Job
Octal is a compact system built on a simple idea: count with eight digits, value each place as a power of 8, and group binary in threes.
With the positional method for Octal to decimal, the division method for decimal to Octal, and the 3-bit shortcut for binary, you can move between all three systems without guessing.
Start with small examples such as 17, 25, and 142 until the steps feel automatic. Then apply the same steps to permission codes such as 755 and 644, where Octal still does real work every day.
Stop doing base-system conversions by hand. Translate legacy computer code instantly using the CalcUnit Octal to Decimal Converter.



