Decimal to Octal Converter
CU-11Paste decimal numbers, one per line, and get octal back. The second button converts octal to decimal. Numbers of any length are converted exactly.
Runs in your browser. Nothing is uploaded.
Numbers (one per line)
Result
How to use it
- Paste one whole decimal number per line.
- Press Decimal to octal. Use Octal to decimal to go the other way.
- Tick Add a prefix to results if you want 0o in front of octal numbers.
- Check the result line by line; an error names the line that failed.
- Copy the result or download it as a .txt file.
How the conversion works
The tool reads each decimal number as an exact integer, then writes it in base 8 by repeated division. 8 becomes 10, 64 becomes 100 and 493 becomes 755. It uses big-integer arithmetic, so a 30-digit number is converted without the rounding that ordinary floating point numbers would introduce. Going back, each octal digit is weighted by a power of eight and the sum is shown in decimal.
Limits and input rules
Only whole numbers are converted. A decimal point or a comma is rejected with a message, because a fraction needs a different method and a comma could mean a thousands separator or a decimal comma. Spaces and underscores inside a number are ignored, and a leading minus sign is kept. Octal input may start with 0o. There is no fixed bit width, so the tool does not show two's complement for negative numbers.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"3.5" is not a whole number. Only whole numbers are converted (no decimal point or comma). | The line has a decimal point or comma. | Convert whole numbers only. Drop the fraction or the thousands separators. |
"9" is not an octal number: "9" is not allowed (use 0-7). | Octal to decimal was pressed on a line that holds an 8 or 9. | Use only the digits 0 to 7 for octal input. |
Questions people ask
How do I convert decimal to octal?
Divide the number by 8 repeatedly and write down the remainders from last to first. For 493: 493 divided by 8 is 61 remainder 5, 61 divided by 8 is 7 remainder 5, and 7 is 7, so the octal is 755. The tool does this for you.
How do I convert octal to decimal?
Multiply each octal digit by 8 raised to its position, counting from the right starting at 0, and add the results. For 755 that is 7 times 64, plus 5 times 8, plus 5, which is 493. Press Octal to decimal to do it for every line.
What is 100 in octal?
100 decimal is 144 in octal: one 64, four 8s and four 1s. Enter 100 and press Decimal to octal to check it. With the prefix option on, it is shown as 0o144.
Is a very large decimal number converted exactly?
Yes. The tool uses exact integer arithmetic instead of floating point, so a number with dozens of digits is converted without rounding. The only limit is what your browser can hold.
Why does it reject a decimal point?
Fractions need a different conversion that can repeat forever, and a comma could be a thousands separator or a decimal comma depending on country. To avoid guessing, the tool accepts whole numbers only and says so in the error.
About this tool
Converts whole decimal numbers to octal, and the second button goes the other way. The conversion uses exact big-integer arithmetic, so numbers of any length are not rounded. Each line is converted on its own. Spaces and underscores inside a number are ignored and a leading minus sign is kept. It does not accept a decimal point or a comma, and it does not convert fractions. The "prefix" option adds 0o to octal results.