About the Decimal to Octal Converter
Octal groups bits three at a time and is best known from Unix file permissions, where 755 and 644 are octal. This tool converts decimal to octal with arbitrary precision, one number per line. For file permission notation specifically, the Unix Permission Calculator is more helpful.
To reverse, use Octal to Decimal; for every base at once, the All Base Converter.
The three-bit grouping is the whole point of the base. Because 8 is 2 to the third power, every octal digit stands for exactly three binary digits, so you can convert by slicing a bit string into threes from the right: 111101101 splits as 111 101 101 and reads 755. Nine bits divide evenly into three octal digits, which is exactly why the permission triads for owner, group and others fit the notation so neatly.
The trap is the leading zero. In C, in Java and in Python 2, writing 0755 means octal, which is decimal 493, while 755 on its own is seven hundred and fifty-five. Modern Python and JavaScript require the clearer 0o755, and a stray leading zero in a config file is a well-worn source of wrong file modes. This tool reads plain decimal input and never assumes that a leading zero means octal. To view the same value as bits, use Decimal to Binary.
How to use
- Paste decimal numbers, one per line.
- Copy the octal results.
Common questions
- Where is octal used?
- Most commonly in Unix file permissions and some legacy systems.
- Does it add a leading 0?
- No. Enable the prefix option in the Number Base Converter for a 0o prefix.
- Big numbers?
- Handled with arbitrary precision.