Skip to the tool
Binary Translator Free tools

Decimal to octal converter

Type a decimal number to get it in octal, with the division steps.

Updated · Written and checked by Murugan Vellaichamy

Waiting for input

Prefixes 0b, 0o, 0x and spaces or underscores between digits are fine. A point starts the fraction.

Result
Try:

How to convert decimal to octal

Divide by 8 and write down the remainder, which is 0 to 7. Divide the quotient by 8 again until it reaches 0, then read the remainders from the bottom up.

DivideQuotientRemainder
493 ÷ 8615
61 ÷ 875
7 ÷ 807

Reading the remainders from the bottom up gives 755, so 49310 = 7558.

Octal digits in binary

OctalBinaryDecimal
00000
10011
20102
30113
41004
51015
61106
71117

Common mistakes

Reading remainders top down

200 gives remainders 0, 1, 3; read top down that’s 013, but 200 is 310

Instead: Read the remainders from the last division back to the first

Stopping too early

Leaving out the final remainder when the quotient reaches 0

Instead: Keep dividing until the quotient is 0; the last remainder is the leftmost digit

Writing a remainder of 8

A remainder is always 0 to 7 when dividing by 8

Instead: If you get 8 or more, the division step is wrong

Writing permissions in octal

The usual reason to convert into octal is a Unix file mode. In the POSIX chmod command each permission is a bit with an octal value: read 4, write 2 and execute 1, in one digit each for the owner, the group and others. Add the bits you want in each digit.

WantedOwnerGroupOthersOctal mode
Owner all, others read and execute4 + 2 + 14 + 14 + 1755
Owner read and write, others read4 + 244644
Owner read and write only4 + 200600

Sources and method

Conversions use exact whole-number arithmetic (JavaScript BigInt), so long numbers keep every digit. Fractions are kept as exact ratios; when the digits repeat, the repeating block is found and marked instead of rounded.

Questions

How do I check the answer?

Convert it back: multiply each octal digit by its power of 8 and add. The octal to decimal converter shows that working.

Is there a quicker way through binary?

Yes. Write the number in binary, group the bits in threes from the right, and swap each group for one octal digit.

More converters

Copied