Chmod Calculator

Convert Unix permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x)

Permission checkboxes
WhoRead (4)Write (2)Execute (1)Sum
Owner (u)7
Group (g)5
Others (o)5
Special0
e.g. 644, 755, 4755
Paste from ls -l too, like -rw-r--r--
Who (u, g, o, a) + action (+, -, =) + permissions (r, w, x, X, s, t). Press Enter to apply.
chmod 755
-rwxr-xr-x
As shown by ls -l
Owner (u)
read, write and run
Group (g)
read and run
Others (o)
read and run
chmod 755 deploy.sh
chmod u=rwx,go=rx deploy.sh
Common permissionstap to use

Runs 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

  1. Choose whether you are setting permissions on a File or a Folder; read, write and execute mean slightly different things for each.
  2. 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 like rwxr-xr-x (you can paste straight from ls -l). All three stay in sync.
  3. To see what a command like chmod go-w or chmod +x would do, type it under Apply a chmod change and press Enter.
  4. Enter the file or folder name, switch on Recursive if needed, and copy the ready-made chmod command in octal or symbolic form.
  5. 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:

Owner : r w x = 4 + 2 + 1 = 7
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

RightOn a fileOn a folder
r (4)Read the contentsList the names of the files inside
w (2)Change the contentsCreate, rename and delete files inside (with x)
x (1)Run it as a program or scriptEnter 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/passwd is 4755 (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. /tmp is 1777 (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".

Frequently Asked Questions

755 gives the owner read, write and execute (7 = 4+2+1), and gives the group and everyone else read and execute (5 = 4+1). In ls -l it shows as rwxr-xr-x. It is the usual setting for folders, scripts and programs: others can use them but only the owner can change them.

Both let only the owner write. 755 adds execute for everyone, which programs and scripts need to run and folders need to be opened. 644 has no execute bit, which suits ordinary files such as HTML pages, images and documents.

OpenSSH refuses private keys that other users can read. Run chmod 600 ~/.ssh/id_ed25519 (or chmod 400 key.pem for an AWS key file) so only you can read it, and keep the ~/.ssh folder at 700.

Usually not. 777 lets every user on the system read, change and run the file, so any compromised account or website on the server can modify it. Fix permission errors by setting the correct owner or group with chown and using 755 for folders and 644 for files.

s in the owner or group position is the setuid or setgid bit: the program runs with the owner's or group's rights. t in the others position is the sticky bit: in a shared folder like /tmp, users can only delete their own files. A capital S or T means the special bit is set but execute is not.

chmod -R applies one mode to everything, so use find instead: find /path -type d -exec chmod 755 {} + for folders and find /path -type f -exec chmod 644 {} + for files. Switch on Recursive in the tool to see these commands for your path.