About the Octal to Decimal Converter
This tool converts octal numbers to decimal with arbitrary precision, one per line. It is useful for interpreting Unix permission values and octal constants from older code. A leading 0 or 0o is accepted and ignored.
To reverse, use Decimal to Octal; to understand a permission value in words, the Unix Permission Calculator.
Each digit is multiplied by a power of eight and the results are added, so 755 works out as 7 times 64 plus 5 times 8 plus 5, which is 493. Only the digits 0 through 7 exist in base 8, so an 8 or a 9 anywhere in the input is not a large digit but an invalid one, and it is reported instead of being guessed at. That single rule catches most mistyped chmod and umask values.
A umask is a common reason to end up here. It clears the bits it names rather than subtracting them, so with a umask of 022 a file created with mode 666 lands at 644 and a directory created with 777 lands at 755. Seeing those values as ordinary numbers makes the bit clearing concrete when you are working out why a deployed file came out group-writable.
How to use
- Paste octal numbers, one per line.
- Copy the decimal results.
Common questions
- Is a leading 0 required?
- No, it is optional. 0o prefixes are also accepted.
- What does 755 convert to?
- The decimal 493, though as a permission it means rwxr-xr-x; see the Unix Permission Calculator.
- Non-octal digits?
- Digits 8 and 9 are reported as invalid for base 8.