Chmod Calculator

Convert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation, including setuid, setgid and sticky bits, and copy the chmod command. Free online chmod calculator.

Related tools
Permissions
Read (r)Write (w)Execute (x)#
Owner (u)6
Group (g)4
Others (o)4
Special bits
Apply a symbolic change (u+x, go-w, a=r …)
Commands
chmod (numeric)
chmod 644 file.txt
chmod (symbolic)
chmod u=rw,g=r,o=r file.txt
ls -l display
-rw-r--r--
Matching umask
umask 0133

With umask 0133, new files are created as 644 and new directories as 644. A umask can only remove bits from the defaults (666 for files, 777 for directories), so it never gives new files execute permission and never sets setuid, setgid or the sticky bit.

Usage examples

Fix "Permissions 0644 for 'id_rsa' are too open"

OpenSSH refuses to use a private key that other users can read. Type 644 into the octal field, untick Read for Group and Others to get 600, and copy chmod 600 ~/.ssh/id_rsa.

Decode a permission string from ls -l

Paste -rwxr-x--- from a directory listing into the symbolic field to see that it is 750: the owner can do everything, the group can read and run it, and everyone else is locked out.

Make a deploy script executable

Start from 644, type u+x into the symbolic change field and apply it to get 744, or use +x to give execute permission to everyone (755) before running ./deploy.sh.

Set up a shared team directory

Tick Target is a directory, enter 2775 and copy the command: group members can create files, and setgid makes every new file inherit the directory's group instead of the creator's primary group.

Pick a umask for a service account

Enter 750, the mode you want new directories to have, and the tool shows umask 0027, which creates new files as 640 and new directories as 750 so other users get no access.

Quick reference

Common chmod modes

OctalSymbolicchmod symbolic formTypical use
400r--------u=r,g=,o=Owner read-only, e.g. an AWS .pem key
600rw-------u=rw,g=,o=Private file: SSH private key, secrets
640rw-r-----u=rw,g=r,o=Config or log readable by a service group
644rw-r--r--u=rw,g=r,o=rRegular files, web pages
664rw-rw-r--u=rw,g=rw,o=rFile edited by a group
700rwx------u=rwx,g=,o=Private directory or script, e.g. ~/.ssh
750rwxr-x---u=rwx,g=rx,o=Directory for owner and group only
755rwxr-xr-xu=rwx,g=rx,o=rxDirectories, executable scripts
775rwxrwxr-xu=rwx,g=rwx,o=rxDirectory a group writes to
777rwxrwxrwxu=rwx,g=rwx,o=rwxAnyone can modify, avoid
4755rwsr-xr-xu=rwxs,g=rx,o=rxsetuid program, e.g. /usr/bin/passwd
2775rwxrwsr-xu=rwx,g=rwxs,o=rxShared group directory
1777rwxrwxrwtu=rwx,g=rwx,o=rwxtShared temp directory, e.g. /tmp

umask and default permissions

umaskNew filesNew directories
0022644 (rw-r--r--)755 (rwxr-xr-x)
0002664 (rw-rw-r--)775 (rwxrwxr-x)
0027640 (rw-r-----)750 (rwxr-x---)
0077600 (rw-------)700 (rwx------)

Frequently asked questions

What does chmod 755 mean?

Each digit is one class: owner, group, others. 7 = read 4 + write 2 + execute 1, so the owner has rwx; 5 = read 4 + execute 1, so the group and everyone else have r-x. Everyone can read and run the file (or open the directory), but only the owner can change it. It is the usual mode for directories and scripts.

What is the difference between 644 and 755?

Only the execute bit for all three classes. 644 (rw-r--r--) suits ordinary files such as HTML, images and config. On a directory, execute means permission to enter it and access the files inside, so a directory needs 755 (or 750, 700) to be usable; a 644 directory can be listed but its files cannot be opened.

How are the octal digits calculated?

Read counts 4, write 2 and execute 1; add them up for each class to get one digit from 0 to 7. An optional fourth leading digit holds the special bits: setuid 4, setgid 2, sticky 1. So rwsr-xr-x is 4755 and rwxrwxrwt is 1777.

What do s, S, t and T mean in ls -l output?

They share the execute position. A lowercase s in the owner or group slot means setuid or setgid is set together with execute; an uppercase S means the special bit is set but execute is not, which is usually a mistake. t and T mean the same for the sticky bit in the others slot.

Why is chmod 777 a bad idea?

777 lets every account on the system modify or replace the file, including a compromised web server or another user on shared hosting. If something only works with 777, the real fix is usually the right owner (chown) or group permissions. Shared drop folders should use 1777 like /tmp so users cannot delete each other's files.

Why did chmod 755 not remove the setgid bit from my directory?

GNU chmod keeps a directory's existing setuid and setgid bits when you give it a numeric mode with fewer than five digits. To clear them, use an extra leading zero (chmod 00755 dir) or a symbolic mode such as g-s. With Target is a directory ticked, this tool always writes the five-digit form.

How does umask relate to chmod?

chmod changes files that already exist; umask decides the permissions of files created afterwards. Programs usually request 666 for files and 777 for directories, and the umask bits are removed from that, so umask 022 gives 644 files and 755 directories, and umask 077 gives 600 and 700.