Octal to Decimal Converter
To convert octal to decimal, multiply each octal digit by a power of 8, counting from 8^0 on the right, and add the results. For example octal 777 is 511 and 755 is 493. Enter an octal number below to see each term.
Decimal result
511
Working
- Write the place values from the right, starting at 8^0: the 3 digit(s) cover 8^2 down to 8^0.
- 7 × 8^2 = 7 × 64 = 448
- 7 × 8^1 = 7 × 8 = 56
- 7 × 8^0 = 7 × 1 = 7
- Add the products: 448 + 56 + 7 = 511.
Example: octal 755 to decimal
- Write the place values from the right, starting at 8^0: the 3 digit(s) cover 8^2 down to 8^0.
- 7 × 8^2 = 7 × 64 = 448
- 5 × 8^1 = 5 × 8 = 40
- 5 × 8^0 = 5 × 1 = 5
- Add the products: 448 + 40 + 5 = 493.
- Result: 493
- Octal 777 = 511
How octal works
Octal is base 8, so it uses only the digits 0 to 7. The rightmost digit is worth 8^0 (1), the next 8^1 (8), then 64, 512 and so on. Each octal digit equals exactly three binary digits, which made octal convenient on older machines with word sizes divisible by three.
Today octal is best known from Unix file permissions: each of the three digits in a mode such as 755 is read, write and execute bits for owner, group and others.
Prefixes, spaces and size
The converter accepts an optional 0o prefix (the Python and JavaScript style) and ignores spaces and underscores. A leading 0, as in the old C style 0755, is simply a leading zero here, so it does not change the value. Numbers can be any size because arithmetic is arbitrary precision.
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.
Invalid digits
The digits 8 and 9 do not exist in octal. If you type one, the tool names it and says to use 0-7. Decimal points are rejected too; only whole numbers are supported.
Frequently asked questions
- What is 777 in octal as a decimal number?
- 511: 7 × 64 + 7 × 8 + 7. It is the largest 9-bit value.
- What does chmod 755 mean in decimal?
- Octal 755 is 493, but permissions are read digit by digit: 7 (rwx) for the owner and 5 (r-x) for group and others.
- Why can’t I enter 8 or 9?
- Octal has eight digits, 0 through 7. A digit of 8 would be written as 10.
- How do I convert octal to decimal by hand?
- Multiply each digit by 8 to the power of its position from the right and add the products.