Binary Translator

Decimal to Octal Converter

To convert decimal to octal, divide the number by 8 repeatedly and record each remainder; the octal number is the remainders read from last to first. For example 511 is 777 and 493 is 755. Enter a whole number below to see every division.

Octal result

777

Working

  1. 511 ÷ 8 = 63, remainder 7
  2. 63 ÷ 8 = 7, remainder 7
  3. 7 ÷ 8 = 0, remainder 7
  4. Read the remainders from the last division up to the first: 777.

Example: 493 to octal

  • 493 ÷ 8 = 61, remainder 5
  • 61 ÷ 8 = 7, remainder 5
  • 7 ÷ 8 = 0, remainder 7
  • Read the remainders from the last division up to the first: 755.
  • Result: 755

The repeated division method

Divide by 8, keep the remainder (always 0 to 7), and divide the quotient again until it is 0. Reading the remainders upward gives the octal digits. The working lists each division; for very long numbers it shows the first 64 and counts the rest, and the result stays exact.

Octal groups bits in threes, so converting through binary is another route: write the number in binary and split it into groups of three from the right.

Defaults

The result has no 0o prefix and no padding, because the tool shows the number rather than a register. Add 0o (Python, JavaScript) or a leading 0 (C) when a language needs it. For Unix permissions, use three digits and pad with a leading zero if needed.

Negative numbers: a leading minus sign is treated as a sign and the digits are converted as the absolute value, so the sign is simply kept in front of the result. This is not two’s complement, which is how processors store negative integers and which depends on a fixed bit width. The tool does not assume a width, so it never reinterprets a high bit as a sign.

Whole numbers only

Decimals and thousands separators are rejected with a message naming the character. The converter uses arbitrary-precision integers, so numbers larger than 64 bits convert exactly.

Frequently asked questions

What is 8 in octal?
10: 8 ÷ 8 = 1 remainder 0, then 1 ÷ 8 = 0 remainder 1.
What is 511 in octal?
777, which is why chmod 777 corresponds to 511.
Can I convert a negative number?
Yes; the sign is kept in front of the result and the digits are those of the absolute value.
Is octal the same as binary?
No, but every octal digit equals exactly three bits, so they convert into each other digit by digit.