DEVESSENTIALS

Chmod Calculator — Linux File Permissions

This chmod calculator converts Linux and Unix file permissions between checkboxes, octal numbers like 755 or 644, and symbolic notation like rwxr-xr-x. Tick read, write and execute for owner, group and others — or type the octal value — and copy the ready-to-run chmod command.

Runs in your browser — nothing is uploaded.Filenames you type for the command stay on your machine.

Read
Write
Execute
Owneru=7
Groupg=5
Othero=5

Special bits (optional 4th digit)

Octal

u=7 g=5 o=5

Symbolic

rwxr-xr-x

owner · group · other

Command

chmod 755 file.sh

Common permissions

How to use the chmod calculator

  1. Tick the permissions each class needs: Owner (the file's user), Group (members of the file's group) and Other (everyone else).
  2. Read the octal value and symbolic string as they update — or type an octal value such as 640 to see which boxes it sets.
  3. Enter a filename and copy the generated command, e.g. chmod 640 app.env.

How chmod numbers are calculated

Each permission has a value: read = 4, write = 2, execute = 1. Add the values you want for each class and write the three sums side by side, owner first. For example, a deploy directory where you need full access, your team can browse, and nobody else can see anything:

Owner  rwx  4 + 2 + 1 = 7
Group  r-x  4 + 0 + 1 = 5
Other  ---  0 + 0 + 0 = 0
                         → chmod 750 deploy/   (rwxr-x---)

Going the other way works the same: 640 is 6 = 4+2 (rw-) for the owner, 4 (r--) for the group and 0 (---) for others, which is a sensible mode for a config file that a service account in your group must read.

Reading permissions from ls -l

$ ls -l
-rwxr-xr-x  1 deploy www-data  2140 Oct 16 09:12 deploy.sh
-rw-r-----  1 deploy www-data   318 Oct 16 09:12 .env
drwxrwsr-x  2 deploy www-data  4096 Oct 16 09:12 shared

The first character is the type (- file, d directory, l symlink); the next nine are owner, group and other in groups of three. So deploy.sh is 755, .env is 640, and shared is 2775 — the s in the group's execute slot means setgid is on.

Common permission errors and how to fix them

  • bash: ./script.sh: Permission denied — the script lacks execute. Run chmod u+x script.sh (or 755 if others must run it).
  • WARNING: UNPROTECTED PRIVATE KEY FILE! Permissions 0644 for 'id_ed25519' are too open. — SSH refuses private keys others can read. Run chmod 600 ~/.ssh/id_ed25519 and chmod 700 ~/.ssh.
  • 403 Forbidden from nginx or Apache on a static file — the web server user can't read the file or can't traverse a parent directory. Files need 644 and every directory in the path needs execute (755), not just the last one.
  • Everything became executable after chmod -R 755 — -R applies the same mode to files and directories. Use chmod -R u=rwX,go=rX dir/: capital X adds execute only to directories (and files that were already executable).
  • New files keep getting the wrong mode — that is your umask. With umask 022, new files are created as 644 and directories as 755; with 002, 664 and 775.

For chown, umask and ACLs in more depth, see Linux file permissions explained.

Common chmod Values Reference

The most frequently used permission values and when to apply them:

OctalSymbolicUse case
755rwxr-xr-xDirectories, public scripts, executables — owner full access, others read+execute
644rw-r--r--Regular files, config files — owner read+write, others read-only
600rw-------.env files, SSH private keys, credentials — owner only, no access for anyone else
400r--------SSH private keys (stricter) — owner read-only. SSH refuses keys that are group/world readable
700rwx------Private directories, scripts with secrets — owner full access, nobody else can enter
750rwxr-x---Web app directories — owner full, group can read+execute, others blocked
664rw-rw-r--Shared files within a group — owner and group can write, others read-only
777rwxrwxrwxEveryone full access — almost always wrong in production. Only use for temp directories if necessary

The three digits represent owner, group, and others. Each digit is the sum of: read (4) + write (2) + execute (1). So chmod 755 = owner gets 4+2+1=7 (rwx), group gets 4+0+1=5 (r-x), others get 4+0+1=5 (r-x).

Common modes, explained one by one

Each page covers what the mode means, when to use it, its security risks and the exact commands. Browse all chmod modes →

Learn more

Browse all developer guides →

Related Tools

Frequently Asked Questions

What does chmod 755 mean?▾

chmod 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 symbolic form it is rwxr-xr-x. It is the standard permission for directories and for scripts or binaries that other users need to run but must not modify.

What does chmod 777 do, and why is it dangerous?▾

chmod 777 (rwxrwxrwx) lets every user on the system read, modify and execute the file. On a server, that means any compromised process — a web app with a file-upload bug, a vulnerable plugin — can overwrite your code or drop a script and run it. It 'fixes' permission-denied errors by removing all protection. The right fix is almost always to correct the owner (chown) or grant only the missing bit, e.g. chmod 775 on a directory shared by a group.

What is chmod +x and when do I need it?▾

chmod +x file adds execute permission. With no u/g/o prefix it applies to all three classes, filtered by your umask — so with the common umask 022 you get rwxr-xr-x from rw-r--r--. You need it before running a script directly (./deploy.sh); without it the shell reports 'Permission denied'. Use chmod u+x to give execute only to yourself.

How do I see a file's current permissions as an octal number?▾

On Linux, run stat -c '%a %n' file (for example, '644 config.yml'). On macOS and BSD, use stat -f '%Lp %N' file. ls -l shows the symbolic form (-rw-r--r--); tick the matching boxes in this calculator to convert it to octal.

What are setuid, setgid and the sticky bit (4755, 2775, 1777)?▾

They are a fourth, leading octal digit. setuid (4) makes an executable run as its owner — /usr/bin/passwd is 4755 so it can update /etc/shadow. setgid (2) on a directory makes new files inherit the directory's group, which is ideal for shared project folders (2775). The sticky bit (1) on a directory lets users delete only their own files — /tmp is 1777. In ls -l they appear as s or t in the execute positions. Tick setuid, setgid or sticky in this calculator (or type a four-digit value like 2775) to include the special digit.

What do the three digits in a chmod octal value (like 755) mean?▾

Each digit represents one of three permission groups: the first digit is the owner (user who owns the file), the second is the group (users in the file's group), and the third is others (everyone else). Each digit is calculated by adding the values of the enabled permissions: read=4, write=2, execute=1. So 755 means owner has rwx (4+2+1=7), group has r-x (4+0+1=5), others have r-x (5). The maximum value per digit is 7 (rwx).

What is the difference between chmod 644 and chmod 600?▾

Both are common for sensitive files, but with a key difference. 644 (rw-r--r--) means the owner can read and write, while the group and others can only read — suitable for non-sensitive config files, web server static files, and documentation. 600 (rw-------) gives read/write only to the owner with no access for anyone else — the correct permission for SSH private keys (~/.ssh/id_rsa), credentials files, and .env files with secrets. Using 644 on a private key will cause SSH to refuse to use it.

Why does execute permission mean different things for files vs directories?▾

For regular files, execute (x) means the file can be run as a program or script. For directories, execute means the ability to traverse (enter) the directory — to cd into it or access files inside it. You typically need execute on every directory in a path to access a file. A common pattern is 755 for directories (owner can do everything, others can read and traverse) and 644 for files inside (owner can read/write, others can read).

How do I apply permissions recursively to all files in a directory?▾

Use chmod -R [mode] directory. However, be careful: -R applies the same mode to both files AND directories, which can cause issues if you set 644 recursively (directories need execute to be accessible). A safer pattern is to use find: 'find /path -type f -exec chmod 644 {} \;' for files, and 'find /path -type d -exec chmod 755 {} \;' for directories, applying appropriate permissions to each type separately.

What is the symbolic chmod syntax (u+x, g-w, o=r) and when should I use it?▾

Symbolic mode lets you modify permissions relative to their current state without knowing the full octal value. u=user/owner, g=group, o=other, a=all. +adds, -removes, =sets exactly. Examples: 'chmod u+x file' adds execute for owner only; 'chmod go-w file' removes write from group and others; 'chmod a+r file' makes a file readable by everyone; 'chmod u=rwx,go=rx file' is equivalent to chmod 755. Use symbolic mode in scripts when you want to add/remove specific permissions without overwriting others.