Chmod Calculator
Convert Unix permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x)
| Who | Read (4) | Write (2) | Execute (1) | Sum |
|---|---|---|---|---|
| Owner (u) | 7 | |||
| Group (g) | 5 | |||
| Others (o) | 5 | |||
| Special | 0 |
chmod 755 deploy.shchmod u=rwx,go=rx deploy.shRuns entirely in your browser. Nothing you type or upload is sent to us or stored.
Results are for general guidance. Please check anything important before relying on it. Terms of use
How to Use
- Choose whether you are setting permissions on a File or a Folder; read, write and execute mean slightly different things for each.
- Tick the boxes for Owner, Group and Others (read, write, execute), plus setuid, setgid or sticky if needed. Or type an Octal mode like
755, or a Symbolic one likerwxr-xr-x(you can paste straight fromls -l). All three stay in sync. - To see what a command like
chmod go-worchmod +xwould do, type it under Apply a chmod change and press Enter. - Enter the file or folder name, switch on Recursive if needed, and copy the ready-made
chmodcommand in octal or symbolic form. - Read the notes under the command: the tool warns about risky settings like 777 and explains special bits. Tap a Common permissions preset to start from a typical value.
How Unix permissions work
Every file and folder on Linux and macOS has an owner, a group and a set of permission bits. The bits say what three kinds of user may do: the owner (u), members of the file's group (g), and everyone else, the others (o). Each of them gets three rights: read (r), write (w) and execute (x). You see them in ls -l output as nine characters, such as -rwxr-xr-x, and you change them with the chmod command.
Octal notation
Each right has a value: read = 4, write = 2, execute = 1. Add the values for each class and write the three sums side by side:
Group : r - x = 4 + 0 + 1 = 5
Others: r - x = 4 + 0 + 1 = 5
Mode : 755 โ rwxr-xr-x โ chmod 755 deploy.sh
Another example: a web page that only you should edit but the web server must read is rw-r--r-- = 6, 4, 4 = 644. An SSH private key must be readable by you alone: rw------- = 600.
What r, w and x mean for files and folders
| Right | On a file | On a folder |
|---|---|---|
| r (4) | Read the contents | List the names of the files inside |
| w (2) | Change the contents | Create, rename and delete files inside (with x) |
| x (1) | Run it as a program or script | Enter the folder and reach the files inside |
That is why folders almost always need x: a folder with r but no x lets you see file names but not open them. It also explains the common pairing of 755 for folders and 644 for files on web servers.
Special bits: setuid, setgid and sticky
A fourth octal digit in front holds three special bits: setuid = 4, setgid = 2, sticky = 1.
- setuid (4xxx) on a program makes it run with the owner's rights.
/usr/bin/passwdis4755(rwsr-xr-x) so ordinary users can update their own password. Linux ignores setuid on shell scripts. - setgid (2xxx) on a folder makes new files inside belong to the folder's group, which keeps shared team folders tidy:
2775. - sticky (1xxx) on a folder means only a file's owner can delete or rename it, even though everyone may write there.
/tmpis1777(rwxrwxrwt).
In the symbolic form a special bit replaces the x: lower-case s or t when x is also set, capital S or T when it isn't.
Symbolic chmod
Instead of numbers you can describe a change: chmod u+x script.sh adds execute for the owner, chmod go-w file removes write from group and others, and chmod u=rw,go=r file sets exactly 644. X (capital) adds execute only to folders and to files that are already executable, so chmod -R a+X site/ fixes folders without making every file executable. When you leave out u, g, o or a (as in chmod +x), real chmod also applies your umask: with the common umask 022, chmod +w adds write for the owner only. This calculator ignores the umask and applies the change to everyone.
Why not just use 777?
777 lets every account on the server change and run the file. If one website or service on a shared server is hacked, the attacker can then modify your files too. "Permission denied" errors are better fixed by giving the right owner (chown) or group access. Typical safe values: 755 for folders and scripts, 644 for normal files, 600 or 400 for private keys and .env files, and 700 for ~/.ssh. OpenSSH refuses to use a private key that other users can read and shows "UNPROTECTED PRIVATE KEY FILE".