Vaultools
Menu
network requests sent: 0

chmod Calculator

Type a numeric mode like 755 or paste the permissions column from ls -l, or tick the boxes. You get the octal and symbolic forms, the chmod command for both, and a plain-English account of who can do what. Everything is worked out in your browser.

Applies to a

Try an example

Permission bits; ticking a box updates the mode
Class Read (4) Write (2) Execute (1) Digit
Owner (u)
Group (g)
Others (o)
Special
Octal
Symbolic (as ls -l shows it)

chmod commands

What this allows

Preview a change

Type a chmod argument such as u+x, go-w or g=u to see what it would do to the mode above.

Ad · placeholder

Your ad could be here — privacy-respecting, no tracking.

Go Pro to remove this →

How Unix permissions work

Every file and directory has an owner, a group, and nine permission bits: read, write and execute for each of three classes of user. The owner (chmod calls it u, for user), members of the file's group (g), and others, meaning everyone else (o). When you access a file, the system picks the first class that applies to you and uses only that class's bits.

The same three letters mean different things on files and directories:

Permission On a file On a directory
r (read, 4) Read the contents List the names inside (ls)
w (write, 2) Change the contents Create, delete and rename entries (needs x too)
x (execute, 1) Run it as a program or script Enter it (cd) and reach anything inside by name

Deleting a file is a change to its directory, not to the file, so it is the directory's write permission that decides it. A read-only file in a directory you can write to can still be deleted.

Reading octal: what each digit means

Each digit of a numeric mode is one class, in the order owner, group, others. The digit is the sum of read (4), write (2) and execute (1), so 755 is 7 = 4+2+1 for the owner, and 5 = 4+1 for group and others.

Digit Symbolic Allows
0 --- No access
1 --x Execute only
2 -w- Write only
3 -wx Write and execute
4 r-- Read only
5 r-x Read and execute
6 rw- Read and write
7 rwx Read, write and execute

Common permission modes

Mode Symbolic Typical use
chmod 400 r-------- Read-only for the owner: private keys some tools insist on, like AWS .pem files
chmod 600 rw------- Private file the owner can edit: SSH private keys, .env files, credentials
chmod 640 rw-r----- Config the owner edits and a service group reads
chmod 644 rw-r--r-- The usual file: owner edits, everyone reads. Web pages, most config
chmod 664 rw-rw-r-- File a team group edits together
chmod 700 rwx------ Private directory or script: ~/.ssh, personal bin scripts
chmod 750 rwxr-x--- Directory or program the owner’s group can use but others can’t
chmod 755 rwxr-xr-x The usual directory and executable: owner changes, everyone uses
chmod 775 rwxrwxr-x Directory or program a team group can change
chmod 777 rwxrwxrwx Everyone can do everything. Almost never the right answer
chmod 1777 rwxrwxrwt Shared scratch directory like /tmp: anyone writes, only owners delete
chmod 2775 rwxrwsr-x Team directory where new files inherit the directory’s group
chmod 4755 rwsr-xr-x Setuid program that runs as its owner, like passwd or sudo

The special bits: setuid, setgid and sticky

A fourth digit in front of the usual three sets the special bits: 4 for setuid, 2 for setgid, 1 for sticky. In ls -l they replace the execute slot of the owner, group and others respectively, in lowercase when execute is also set and in uppercase when it isn't.

GNU chmod keeps a directory's setuid and setgid bits when you give it a three- or four-digit mode. To clear them numerically, use five digits such as 00755, or use g-s.

Symbolic chmod syntax

A symbolic argument changes permissions relative to what's already there, which a numeric mode can't do. It reads as who, operator, permissions: go-w removes write from group and others and leaves everything else alone.

Part Meaning Example
u g o a Who: user (owner), group, others, all three go-w
+ - = Add, remove, or set exactly (clearing the rest) u=rw
r w x Read, write, execute a+r
X Execute, but only for directories and files that already have x for someone chmod -R a+X dir
s Setuid with u, setgid with g g+s
t Sticky bit, with o or a o+t
u g o (after = + -) Copy another class’s permissions g=u
, Separate several changes u+x,go-w

Leaving out who (chmod +x) means all three classes, except that chmod then won't touch any bit your umask masks. With the common umask 022, chmod +w adds write for the owner only.

umask: the permissions new files get

Programs usually create files with mode 666 and directories with 777, and the umask then removes bits from that. It works like a mode written in reverse: each 1 bit in the umask is a permission new files won't get. Run umask to see yours.

umask New files New directories Where you see it
022 644 (rw-r--r--) 755 (rwxr-xr-x) The common default
002 664 (rw-rw-r--) 775 (rwxrwxr-x) Common on systems that give each user their own group
027 640 (rw-r-----) 750 (rwxr-x---) Hardened servers: nothing for others
077 600 (rw-------) 700 (rwx------) Private: only the owner

Mistakes that cause trouble

FAQ

What does chmod 755 mean?

The owner can read, write and execute (7), and the group and everyone else can read and execute (5). In ls -l it shows as rwxr-xr-x. It's the normal mode for directories and for programs and scripts others need to run.

What's the difference between 644 and 755?

Only execute. 644 (rw-r--r--) suits ordinary files, which don't need to be run. 755 adds execute for everyone, which a directory needs before anyone can enter it and a script needs before it can be run directly.

What does chmod +x do?

It adds execute permission so the file can be run as ./script.sh. Without a who letter, it applies to owner, group and others, minus anything your umask masks, so under the usual umask 022 a 644 file becomes 755. Use chmod u+x to add it for yourself only.

How do I see a file's permissions as a number?

On Linux, stat -c '%a %n' file prints the octal mode. On macOS, use stat -f '%Lp %N' file. ls -l only shows the symbolic form, which you can paste into this calculator.

How do I set files and directories to different modes?

Use find to separate them: find dir -type d -exec chmod 755 {} + for directories and find dir -type f -exec chmod 644 {} + for files.

Related glossary terms