Numbers · base 8Octal numbers
Convert a number to octal and back. Type a value in any base — you get the others, a digit-by-digit breakdown and, when the number looks like file permissions, a ready chmod reading.
Convert
type a number in any baseDigit lanes
step the digits with the arrows — the number changes as you goEvery digit is a value multiplied by a power of eight. Under each digit is its group of three bits: eight is two to the third power, so one octal digit covers exactly three bits. Hence the permissions — read, write and execute are those very three bits.
File permissions (chmod)
tick the boxes — the octal code is recomputedOnly the owner can write — the usual, safe scheme for project files and directories.
Conversion table
click a row to load the valueAbout octal
Octal uses the digits from zero to seven. One digit is exactly three bits, and that is why it outlived the era it was made for: Unix permissions come in triples of read, write and execute, and a triple of bits is one octal digit. Elsewhere hexadecimal replaced it, because hex maps onto a byte exactly.
One digit is three bits
TriadFile permissions
UnixThe leading zero
SyntaxSpecial bits
Fourth digitWhy hex replaced it
HistoryString escapes
In practiceFrequently asked questions
Works with non-negative integers of any length. Permissions are read for three and four digits; what the special bits actually do depends on the system.