A file permission
755
493
7 × 64 + 5 × 8 + 5 × 1 = 448 + 40 + 5 = 493.
Type an octal number and read its decimal value, with the working shown underneath. It opens on 755, the most common file permission, which is 493.
Last updated
Coddy teaches you by writing real code in your browser - interactive lessons, instant feedback, and AI help when you get stuck.
Octal is base 8, so it uses the digits 0 to 7 and each position is worth eight times the one to its right: 1, 8, 64, 512, 4096. The digits 8 and 9 never appear in an octal number.
To convert, multiply each digit by its place value and add. 17 is 1 × 8 + 7 = 15, and 100 is 1 × 64 = 64. The panel under the converter shows these lines for whatever you type.
Octal survives mainly in Unix file permissions, where each digit packs three bits: read (4), write (2) and execute (1). That is why chmod 755 gives the owner read, write and execute, and everyone else read and execute.
0o marks octal (0o755 in Python and JavaScript); in C a leading 0 does.755
493
7 × 64 + 5 × 8 + 5 × 1 = 448 + 40 + 5 = 493.
17
15
1 × 8 + 7 = 15, one less than octal 20, which is 16.
600
384
6 × 64 = 384: read and write for the owner, nothing for anyone else.
777
511
7 × 64 + 7 × 8 + 7 = 511, one less than 8³, which is 512.
10 is eight.0755 as decimal. The leading 0 makes it octal, so its value is 493.chmod 755 expects octal, so pass the digits as they are.int('755', 8) returns 493. In JavaScript, parseInt('755', 8) does the same.chmod 644 and chmod 755, and in a few older file formats. Each octal digit holds three bits, which matches the three permission flags.