Octal to Decimal Converter

Decimal and hex values for an octal number such as a chmod mode.

How it is calculated

Each octal digit is multiplied by a power of 8 according to its position, counting from 0 on the right, and the products are added: decimal = Σ dᵢ × 8i. The same value is also shown in hexadecimal with a 0x prefix and upper-case letters. Spaces inside the input are ignored, and leading zeros do nothing, so 0755 and 755 are the same. Only the digits 0 to 7 are accepted: an 8 or 9, a minus sign, a decimal point or a prefix such as 0o gives no result, as does an empty box. The largest value that can be converted is 21 sevens, which equals 9,223,372,036,854,775,807 (263 − 1); anything longer is refused rather than shown with lost digits. Only whole non-negative numbers are handled.

Worked example

Convert the Unix permission 755. From the right, the digits 5, 5, 7 sit at powers 0, 1, 2 of 8. So 7 × 64 = 448, 5 × 8 = 40 and 5 × 1 = 5. Adding them: 448 + 40 + 5 = 493. The tool shows decimal 493 and hexadecimal 0x1ED. Likewise octal 644 equals 420 in decimal, which is 0x1A4.

Try this example →

Common mistakes

  • Entering a digit 8 or 9, as in 189 or 98. Octal only has 0 to 7, so the tool gives no result instead of guessing.
  • Typing the prefix used in programming languages, such as 0o755 or 0755 with letters. A plain 0755 works, but 0o755 contains the letter o and is rejected.
  • Reading the decimal result as the permission digits. 493 is the number of the permission set, not the chmod string; chmod expects 755 itself.
  • Entering negative numbers or fractions, such as -17 or 17.5. Only whole, non-negative octal numbers are converted.
  • Pasting a value above the limit, such as 1777777777777777777777. The limit is 21 sevens (263 − 1); larger numbers are rejected.

About this calculator

Converting octal (base-8) to decimal means summing each digit multiplied by 8 raised to its position power — for example octal 17 = 1×8¹ + 7×8⁰ = 15 in decimal — since octal only uses digits 0-7, with each digit representing exactly 3 bits.

Octal was the natural shorthand for early computers with word lengths divisible by 3 bits, and it survives today mainly in Unix/Linux file permission notation (chmod 755, for instance), so developers and system administrators still occasionally need to convert an octal permission or legacy value into decimal or hexadecimal to interpret or set it correctly.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A common place this matters is code that sets file permissions. Many languages treat a leading 0 as octal, so writing 0755 gives the permission set you wanted, while a plain decimal 755 is the different octal value 1363 and sets odd permissions. If a script is applying the wrong mode, convert the number you wrote and compare it with what you intended. In which language or tool did an octal value trip you up?

Popular calculators

All Calculators