1. Home
  2. Developer tools
  3. Decimal to Octal

Decimal to Octal

Enter a decimal number and read it in base 8. The page divides by eight again and again, lists each remainder from last to first, and checks the answer by converting back.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Decimal to Octal

  1. Enter decimal numbers, one per line.
  2. Read the octal value and the division table.
  3. Copy the result, with an optional 0o prefix.

Features

  • Division-by-8 table with the remainders
  • Exact for integers of any size
  • Fractions by repeated multiplication
  • Negative numbers keep their sign
  • Optional 0o prefix
  • Binary and hex shown beside it

Supported formats

Input

  • Typed or pasted numbers

You get

  • Octal
  • Division table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Decimal to Octal is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Fractions that do not end in the target base are cut after 24 digits and marked with an ellipsis.
  • Negative numbers are shown with a minus sign, not as a bit pattern.

Guide

Decimal to octal by dividing by eight

Dividing by eight is the same idea as dividing by ten when you write down the digits of a decimal number, only the base is different. This page performs the division chain and prints every line, which is what an exercise sheet or a teacher usually wants to see, and it also handles the cases where the chain would be tedious: big numbers, negatives and fractions.

The procedure

Divide the decimal number by 8 and record the whole-number quotient and the remainder. The remainder is a digit from 0 to 7. Repeat with the quotient until it reaches zero. The octal number is the remainders written in reverse order, so that the last remainder you found is the first digit. Each step strips off the lowest octal digit, in the same way that dividing by ten strips the last decimal digit.

Checking by converting back

Octal positions are worth 1, 8, 64, 512, 4,096 and so on. To verify an answer, multiply each digit by its position’s worth and add. If you get the number you began with, the conversion was right. The reverse page, octal to decimal, prints this sum for you, and the “same number in other bases” box here lets you compare the binary form, where octal digits correspond to groups of three bits.

Options

Add the 0o prefix to produce the literal that Python and modern JavaScript accept. Group digits for readability if the number is long. Paste several numbers on separate lines to convert them in one go. An invalid line gets its own message, and the valid ones are still converted.

Edge cases

Negative values are shown with a minus sign in front of the octal digits. The page does not produce complement forms. Decimal fractions work by multiplying the fractional part by 8 and taking the whole part as the next digit; 0.5 is 0.4, because half of eight is four. A fraction like 0.1 does not end and is truncated with an ellipsis.

A common confusion is to read a permission mode such as 755 as the decimal number seven hundred and fifty-five. As octal it is 493 in decimal, and that figure has no meaning for chmod.

A worked example

The Sample button loads 2026. Dividing: 2026 ÷ 8 = 253 remainder 2; 253 ÷ 8 = 31 remainder 5; 31 ÷ 8 = 3 remainder 7; 3 ÷ 8 = 0 remainder 3. Reading the remainders from the bottom gives 3752. Check: 3 × 512 is 1,536, 7 × 64 is 448, 5 × 8 is 40 and 2 is 2, which total 2,026. The box underneath adds binary 11111101010 and hexadecimal 7EA for comparison.

Limits

The page converts values. It does not decide that a number is a file mode, a character code or a date, and it does not check the result against any file system. If the target is a Unix mode, use the chmod calculator, which builds the digits from permission choices and avoids the decimal detour altogether. Octal conversions of fractions are approximate beyond 24 digits, by design.

Checked against the current version of the Decimal to Octal on .

Frequently asked questions

Is there a quick way to check a decimal-to-octal answer?

Convert it back. Multiply each octal digit by the matching power of eight and add the products. For 3752 that is 3 × 512 + 7 × 64 + 5 × 8 + 2, which gives 2,026, the number you started with.

Can any decimal fraction be written exactly in octal?

Only those whose denominator, in lowest terms, has no factors except 2. Decimal 0.125 is exactly 0.1 in octal, but 0.1 has no finite octal form, so the page stops after 24 digits and marks it.

What is 493 in octal?

755. Dividing 493 by 8 gives 61 remainder 5, then 7 remainder 5, then 0 remainder 7, and the remainders read upwards are 7, 5, 5.

Is octal used in permissions as a decimal?

No. The digits 7, 5, 5 are bit groups, not a decimal number. 755 octal is 493 in decimal, which is not a number you would type into chmod.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.