chmod calculator

The chmod calculator converts Linux file and directory permissions between numeric and symbolic notation, and builds a command ready to copy.
Owner
Group
Public
Special permissions
3 or 4 digits, each from 0 to 7
Symbolic value
rw-r--r-- 644
Command
chmod 0644 -- file

Everything runs in your browser; nothing is sent or stored.

  • Tick read, write, and execute for the owner, the group, and the public, or type a 3- or 4-digit numeric value.
  • The calculator shows the symbolic value, for example rw-r--r--, and the full chmod command.
  • The setuid, setgid, and sticky permissions are selected separately and appear in the symbolic value in place of the execute permission, as s and t.
  • Enter the file or directory name. A name with spaces or special characters is wrapped in single quotes in the command.
  • Click "Copy" to copy the command, then paste it into your server's terminal.

How Linux file permissions work

Every file and directory in Linux has an owner, a group, and a set of permissions. Permissions are set for three classes of users: the file's owner, members of the group the file belongs to, and all other users on the server. Each class has three permissions: read (r), write (w), and execute (x). On a directory, read lets you list the files in it, write together with execute lets you create, rename, and delete files inside it, and execute lets you enter the directory and access the files in it.

Each digit in the numeric value stands for one class of users, in this order: owner, group, and public. The digit is the sum of the permission values: read is 4, write is 2, and execute is 1. For example, the digit 7 is 4+2+1, meaning read, write, and execute, and the digit 5 is 4+1, meaning read and execute. So the value 755 equals rwxr-xr-x: the owner has every permission, while the group and the public can only read and execute. In the calculator, the checkboxes and the numeric value update each other.

Common values and special permissions

The value 644 (rw-r--r--) suits regular files, such as HTML pages, images, and code files that the server reads. The value 755 (rwxr-xr-x) suits directories and scripts that need to run. The value 600 (rw-------) is for private keys and sensitive configuration files, so only the owner can read and change them. The value 700 (rwx------) is for a directory or script that belongs to a single user, such as the ~/.ssh directory.

When a fourth digit appears at the start of the value, it sets the special permissions: 4 for setuid, which runs an executable with its owner's permissions; 2 for setgid, which on a directory makes new files inherit the directory's group; and 1 for sticky, which on a directory lets only the file's owner, the directory's owner, and root delete or rename a file, as in the /tmp directory, which is set to 1777. Linux ignores setuid on scripts that run through an interpreter, so the permission only works on binary executables.

Common examples

  • chmod 644 index.htmlRead and write for the owner, read only for the group and the public.
  • chmod 755 deploy.shLets the script run, while only the owner can change the file.
  • chmod 600 ~/.ssh/id_ed25519A private key that only the owner can read and change.
  • chmod 700 ~/.sshA private directory that only the owner can enter.
  • find /var/www/site -type d -exec chmod 755 {} +Sets 755 on every directory in the tree and leaves the files unchanged.
  • chmod 2775 sharedA shared team directory where new files get the directory's group.
Did you know?

A Linux VPS gives you full root access, so you can set permissions and ownership on every file and directory.

Linux VPS plans

chmod calculator FAQ

What is the difference between chmod 644 and chmod 755?

The value 644 gives the owner read and write access and everyone else read-only access, with no execute permission. The value 755 adds execute permission for everyone, which makes it the right choice for directories and scripts.

Can I set 777 permissions on a website directory?

It is technically possible, but 777 lets every user and every process on the server change the files. In most cases, a write problem is solved by setting the correct owner with chown, not by opening the permissions to everyone.

Can I run chmod -R 755 on the whole website directory?

The command chmod -R 755 gives execute permission to every file, including files that are not scripts, so we do not recommend it. Apply 755 to directories and 644 to files separately with the find command.

What does the first digit in a value like 0644 mean?

In a four-digit value, the first digit is the sum of the special permissions, and 0 means that no special permission is selected. On directories, chmod in Linux keeps any existing setuid and setgid bits even with a value like 0755. To clear them, use a five-digit value, such as chmod 00755, or run chmod u-s,g-s.

Why does the generated command include -- before the file name?

The -- marks the end of the command's options, so a file name that starts with a hyphen is not read as an option.

How do I check the current permissions of a file?

The ls -l command shows the permissions in symbolic form, for example -rw-r--r--. The command stat -c '%a %n' file shows them in numeric form.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement