How do I use the chmod calculator?
Tick the read, write and execute boxes for the owner, the group and others, or type an octal value like 755 in the box, or tap a preset. All three views stay in sync: the checkboxes, the octal number and the symbolic string such as rwxr-xr-x. The details spell out in plain words what each class can do, and the ready-to-run command (for example "chmod 755 file") is shown for copying. The default is 755; press Sample to load 644, the usual setting for regular files.
What does chmod do?
chmod (change mode) is the Unix and Linux command that sets who may read, write or execute a file or directory. Every file has an owner, a group and everyone else ("others"), and each of the three classes gets its own read/write/execute settings. Getting these right matters: too open and anyone can modify your files; too closed and your website or scripts stop working. This calculator translates between the numeric form used in commands and the letter form shown by ls -l.
How do octal permissions work?
Each class becomes one digit by adding read (4), write (2) and execute (1). Read plus execute is 5, read plus write is 6, all three is 7, and none is 0. The three digits are written in owner, group, others order, so 755 means owner 7 (rwx), group 5 (r-x) and others 5 (r-x), giving rwxr-xr-x. An optional fourth leading digit carries the special bits: setuid 4, setgid 2 and sticky 1, so 4755 is 755 with setuid added.
What do r, w and x mean?
For a file, r means it can be read, w means it can be changed, and x means it can be run as a program. For a directory, r means you can list its contents, w means you can create, rename or delete files inside it, and x means you can enter it and access the files within. That is why directories normally need x to be useful at all, and why the common pair is 755 for directories (everyone can enter and list, only the owner can change) and 644 for files (owner can edit, everyone can read).
What are the special bits?
Three extra bits sit in front of the usual nine. Setuid (shown as s in the owner's execute slot) makes a program run with its owner's rights instead of yours; setgid does the same for the group, and on directories makes new files inherit the directory's group. The sticky bit (t in the others slot) on a directory such as /tmp means only a file's owner can delete it, even though everyone can write there. In ls -l output they appear as s or t, or as capital S or T when the matching execute bit is off.
Is it free and private?
Yes. The chmod calculator is completely free, needs no sign-up, and runs entirely in your browser. Nothing is sent to a server. It works on phones, tablets and desktop computers, so you can work out a permission string anywhere.