curly{bits}

curlybits / chmod Calculator

chmod Calculator

Work out Linux and Unix file permissions in any format. Tick read, write and execute for the owner, group and others, or type a number like 755 or a string like rwxr-xr-x, and the others update. The chmod command is ready to copy.

Read (4)Write (2)Execute (1)Digit
Owner0
Group0
Others0
chmod 755 file

How to use the chmod Calculator

  1. Tick the permissions you want for Owner, Group and Others.
  2. Or type the octal number (like 644) or the symbolic form (like rw-r--r--).
  3. Add setuid, setgid or the sticky bit if you need them.
  4. Copy the chmod command.

How the numbers work

Each digit is the sum of read (4), write (2) and execute (1), for the owner, the group and everyone else in that order. So 7 = 4 + 2 + 1 = read, write and execute, 5 = 4 + 1 = read and execute, and 4 = read only.

NumberSymbolicTypical use
644rw-r--r--Normal files: web pages, images, config
755rwxr-xr-xFolders and scripts that everyone may run
600rw-------Private files, such as SSH keys and .env files
700rwx------Private folders and scripts
775rwxrwxr-xShared folders for a team group
777rwxrwxrwxAnyone can change it. Avoid on servers

Special bits

A fourth digit in front adds special modes: 4 setuid (run as the file's owner), 2 setgid (run as the group, or new files in a folder inherit its group) and 1 sticky (only owners can delete their files in a shared folder, as on /tmp, which is 1777).

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and run it; the group and everyone else can read and run it, but not change it.

What's the difference between 644 and 755?

755 adds execute permission for everyone. Folders need execute to be opened, so use 755 for folders and 644 for ordinary files.

Is chmod 777 dangerous?

On a server, yes. Any user or compromised process can change or replace the file. Use the lowest permissions that work.

How do I apply it to a folder and everything inside?

Add -R: chmod -R 755 folder. Careful: this also makes every file executable. Many people run find to give folders 755 and files 644 separately.

Updated

Add this chmod calculator to your website

Free for blogs, schools and businesses. Copy the code below and paste it into your page's HTML. The tool works exactly like this one and runs in your visitors' browsers, so nothing is uploaded. Please keep the credit line so others can find it too.

Preview embed ↗