chmod Calculator: Unix file permissions in octal and symbolic form

Permissions

Owner
Group
Others

Special bits

Octal and symbolic

Common presets

Command

Numeric–
Symbolic–

What this allows

    On a directory, read lists its contents, write adds or removes entries and execute lets you enter it.

    About chmod Calculator

    This tool works out Unix file permissions. Tick the read, write and execute boxes for the owner, the group and everyone else, add the setuid, setgid and sticky bits if you need them, and read off the octal number, the symbolic string and the chmod command.

    You can also go the other way. Type an octal mode such as 755 or 4755, or a symbolic string such as rwxr-xr-x, and the grid updates to match. A plain-English list explains who can read, write and run the file, and a warning appears for risky modes such as 777.

    The command can be copied in numeric or symbolic form, with an optional -R for directories and your own file name. Everything is calculated in your browser, so nothing is uploaded.

    How to use it

    1. Tick the boxes, pick a preset, or type an octal or symbolic value.
    2. Check the plain-English list to confirm who gets which access.
    3. Add a file name and -R if you need them, then copy the numeric or symbolic command.

    Frequently asked questions

    What do the numbers in chmod 755 mean?

    Each digit is one class: owner, group, then others. Read counts as 4, write as 2 and execute as 1, and you add them up. So 7 is read, write and execute (4+2+1), and 5 is read and execute (4+1). 755 means the owner can do everything while the group and others can read and run the file.

    What is the difference between 644 and 755?

    644 lets the owner read and write and everyone else only read. It suits normal files such as documents and web pages. 755 adds execute for everyone, which is needed for scripts, programs and directories.

    Why is chmod 777 a bad idea?

    777 lets every user on the system read, change and run the file. On a web server that can let an attacker modify your code. It is almost always better to give write access to one owner or one group, and the tool warns you when you choose it.

    What are setuid, setgid and the sticky bit?

    They are three extra bits shown as a fourth leading digit: 4 for setuid, 2 for setgid and 1 for sticky. Setuid and setgid run a program with the owner's or group's privileges. On a directory, setgid makes new files inherit the group, and the sticky bit, as on /tmp, stops users deleting files they do not own.

    What does a capital S or T mean in the symbolic string?

    A lowercase s or t means the special bit is set and execute is also set. A capital S or T means the special bit is set but execute is not, which is usually a mistake.

    What does -R do?

    It applies the change to a directory and everything inside it. Be careful: the same mode is usually wrong for both files and directories, because directories need execute to be entered.

    Is anything uploaded?

    No. The calculation runs in your browser and nothing you type is sent or stored.