Decimal to Octal Converter
Turn decimal into octal quickly. Type your number, convert instantly, and copy the result for coding work, assignments, and verification.
Enter your Decimal Digits
What the decimal to octal converter does
This takes an ordinary decimal number and writes it in octal, the base-8 system. Type your number in, press the button, and copy out the octal.
Most often the reason you want octal is the other way round from reading it: you know the permissions you want on a file and you need the octal number that sets them. This tool gives you that number from a plain decimal value.
How to use it
- Enter your decimal number. Type the everyday whole number you want in octal, for example 100.
- Press Convert. The octal version appears in the output box, using only the digits 0 to 7.
- Click the result to copy it. Tap the output to send it to your clipboard.
Press Reset to clear both boxes.
How it works: divide by eight
Writing a number in octal uses the same divide-and-collect-remainders method you would use for binary, except you divide by 8, because octal is base 8. You divide the number by 8 and note the remainder, which is always somewhere from 0 to 7. Then you divide the quotient by 8 and note that remainder, and you keep going until the quotient reaches 0. Read the remainders from the bottom up and that is your octal number.
There is no letter business here the way there is with hex, because every remainder is 0 to 7, which are all ordinary single digits.
A worked example with real numbers
Let us convert 100.
- 100 ÷ 8 = 12, remainder 4
- 12 ÷ 8 = 1, remainder 4
- 1 ÷ 8 = 0, remainder 1
Read the remainders from the bottom up: 1, 4, 4. So 100 in decimal is 144 in octal. To check it, read it back by place value: 1 × 64 + 4 × 8 + 4 = 64 + 32 + 4 = 100.
Building a file permission with it
The most useful place this comes up is setting permissions on a Unix or Linux file, and here octal is built for the job. A file has three groups of permissions, for the owner, the group, and everyone else, and each group has three switches: read worth 4, write worth 2, and execute worth 1. You add up the switches you want on, which gives a digit from 0 to 7 for each group, and three of those digits is exactly an octal number.
So suppose you want the owner to read, write, and execute, and you want the group and others only to read and execute. The owner is 4 plus 2 plus 1, which is 7. The group and others are each 4 plus 1, which is 5. Put them together and the permission is 755. Because each group already lands in the 0 to 7 range, this thinking is pure octal from the start, which is the whole reason permissions are written this way.
Questions people ask
How do I convert decimal to octal by hand?
Divide the number by 8 and note the remainder, then divide the quotient by 8 and note that remainder, and keep going until the quotient is 0. Read the remainders from the bottom up.
What is 100 in octal?
144. Dividing 100 by 8 repeatedly gives remainders of 4, 4, and 1, which read from the bottom up as 144.
Why does octal have no letters when hex does?
Because octal digits only go up to 7, and every one of those is an ordinary single digit. Hex needs letters because its digits run to 15, beyond what a single number symbol can show.
Why do some languages put a zero in front of octal numbers?
A leading zero is a common way to mark a number as octal in code, so 0144 means octal rather than decimal. It is worth knowing, because writing 0100 when you meant the decimal 100 is a classic bug.
References
- Weisstein, Eric W. "Octal." From MathWorld, A Wolfram Resource. https://mathworld.wolfram.com/Octal.html
- IEEE and The Open Group. chmod, change the file modes. The Open Group Base Specifications (POSIX.1-2017). https://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.