Skip to content

Chmod Calculator

Tick the permissions each class of user should have and read off the octal number, the rwx string that ls -l prints, and a chmod command with your path already in it.

Runs in your browserFree, no sign-upLast reviewed

Settings

Results update automatically as you type.

Permissions

Octal
755
The number you pass to chmod
Symbolic
rwxr-xr-x
As shown by ls -l
Owner
rwx (7)
Group
r-x (5)
Other
r-x (5)

Command

chmod 755 file.txt

Common permission values

OctalSymbolicTypically used for
644rw-r--r--Regular files — owner edits, everyone reads
755rwxr-xr-xDirectories and executables
600rw-------Private files such as SSH keys and .env
700rwx------Private directories, e.g. ~/.ssh
664rw-rw-r--Group-writable shared files
777rwxrwxrwxEverything for everyone — avoid on real servers

Quick answers

What does chmod 755 mean?
The owner can read, write and execute (7 = 4 + 2 + 1); the group and everyone else can read and execute but not write (5 = 4 + 1). In symbolic form it is rwxr-xr-x. It is the usual mode for directories and for scripts and programs that anyone may run.
What does chmod 644 mean?
The owner can read and write (6 = 4 + 2); the group and everyone else can only read (4). In symbolic form it is rw-r--r--. It is the usual mode for ordinary files such as HTML pages, images and configuration that holds no secrets.
How do you calculate a chmod number?
Add 4 for read, 2 for write and 1 for execute, separately for the owner, the group and other, then write the three totals side by side. Read and write for the owner (6), read for the group (4) and nothing for other (0) gives 640.
What is rwxr-xr-x in octal?
755. Split the string into three groups of three: rwx is 7, r-x is 5 and r-x is 5. Each letter present adds its value (r = 4, w = 2, x = 1) and each dash adds nothing.
What chmod should an SSH private key have?
600, written rw------- in symbolic form: the owner can read and write and nobody else has any access. The ~/.ssh directory itself should be 700. OpenSSH refuses to use a private key that other users can read and reports that the permissions are too open.
Is chmod 777 safe?
Rarely. 777 (rwxrwxrwx) lets every account on the machine read, change and run the file, so any compromised or careless user can replace its contents. On shared hosting and servers, use 644 for files and 755 for directories, and fix ownership with chown if access is still denied.

What Chmod Calculator does

A chmod number is three digits, one each for the owner, the group and everyone else. Each digit is the sum of read (4), write (2) and execute (1), so 7 is rwx, 6 is rw-, 5 is r-x and 4 is r--. This calculator does that sum for you: tick the nine boxes and it returns the octal value, the nine-character symbolic string and a ready command such as chmod 755 file.txt. The boxes start at 755. It works in one direction, from ticks to number, and it covers the three standard digits only, so setuid, setgid and the sticky bit are not included.

Chmod number chart: what each digit 0 to 7 means

Every digit in a mode is one row of this table. The same eight values apply to the owner, group and other positions.

DigitSymbolicSumPermissions
0---0No access
1--x1Execute only
2-w-2Write only
3-wx2 + 1Write and execute
4r--4Read only
5r-x4 + 1Read and execute
6rw-4 + 2Read and write
7rwx4 + 2 + 1Read, write and execute

Because 4, 2 and 1 are powers of two, each total can only be reached one way, which is why a single digit is never ambiguous.

Common chmod values and what they are used for

Octal and symbolic pairs below were produced with the calculator above.

OctalSymbolicWho can do whatTypical use
400r--------Owner reads; nobody else has accessRead-only key files, such as a downloaded .pem key
444r--r--r--Everyone reads; nobody writesFiles that should not be edited by accident
600rw-------Owner reads and writes; nobody else has accessSSH private keys, .env files, password stores
640rw-r-----Owner reads and writes; group readsConfig files a service group needs to read
644rw-r--r--Owner reads and writes; everyone else readsOrdinary files, web pages, images
660rw-rw----Owner and group read and writeFiles shared inside one group only
664rw-rw-r--Owner and group read and write; other readsGroup-edited files that are public to read
666rw-rw-rw-Everyone reads and writesSeldom appropriate for a file on disk
700rwx------Owner has full access; nobody else has accessPrivate directories such as ~/.ssh
711rwx--x--xOwner full; others may pass through but not listA home directory that exposes one known subfolder
750rwxr-x---Owner full; group reads and entersApplication directories closed to other users
755rwxr-xr-xOwner full; everyone else reads and executesDirectories, shell scripts, programs
770rwxrwx---Owner and group full; other has no accessA team directory
775rwxrwxr-xOwner and group full; other reads and entersShared project directories
777rwxrwxrwxEveryone has full accessAlmost never the right fix on a server

Worked examples from tick boxes to command

Make a deploy script runnable

Owner read, write, execute; Group read, execute; Other read, execute; Path deploy.sh

Octal 755, Symbolic rwxr-xr-x, Command: chmod 755 deploy.sh

These are the boxes ticked when the page first loads.

Lock down an SSH private key

Owner read and write only; every Group and Other box cleared; Path ~/.ssh/id_ed25519

Octal 600, Symbolic rw-------, Command: chmod 600 ~/.ssh/id_ed25519

Config file that a service group must read

Owner read and write; Group read; Other nothing; Path /etc/myapp/config.yml

Octal 640, Symbolic rw-r-----, Command: chmod 640 /etc/myapp/config.yml

Directory a whole team writes to

Owner read, write, execute; Group read, write, execute; Other read and execute; Path /srv/project

Octal 775, Symbolic rwxrwxr-x, Command: chmod 775 /srv/project

Why directories use 755 when files use 644

The execute bit means something different on a directory. On a file it lets the system run the file as a program. On a directory it lets a user pass through it: cd into it and open the things inside by name. Take execute away from a directory and everything beneath it becomes unreachable, even files that are themselves readable by everyone.

Read on a directory is narrower than it sounds. It allows listing the names inside, not opening them. A directory with read but no execute shows that a file exists and then refuses every attempt to use it, which produces permission denied errors that look as if they come from the file.

That is the reason for the common pairing: 755 on directories so they can be entered, 644 on files so they can be read but not run. To apply both to a whole tree without mixing them up, run find . -type d -exec chmod 755 {} + for the directories and find . -type f -exec chmod 644 {} + for the files, instead of a single chmod -R.

Octal mode and the matching symbolic chmod command

chmod also accepts letters: u for the owner, g for group, o for other and a for all three. The = form sets a class exactly, like a number does; + and - change single bits and leave the rest alone.

GoalNumericSymbolic equivalent
Set a directory or script to rwxr-xr-xchmod 755 pathchmod u=rwx,go=rx path
Set a file to rw-r--r--chmod 644 pathchmod u=rw,go=r path
Set a private file to rw-------chmod 600 pathchmod u=rw,go= path
Add execute for the owner onlyNo single number; depends on the current modechmod u+x path
Remove write from group and otherNo single number; depends on the current modechmod go-w path
Let everyone readNo single number; depends on the current modechmod a+r path

This calculator outputs the numeric form only.

What this calculator does not cover

  • Special bits. A fourth leading digit sets setuid (4), setgid (2) and the sticky bit (1), as in 1777 on /tmp or 2775 on a shared directory. The tool works with three digits only.
  • Typing a number in. There is no octal input box; to decode a mode, look it up in the chart above or tick boxes until the Octal value matches.
  • Ownership. chmod changes what the owner, group and other may do, not who the owner and group are. That is chown and chgrp.
  • Quoting. The path is placed in the command exactly as typed, so a name with spaces needs quotes or backslashes added before you run it.
  • Recursion. The command targets one path. Add -R yourself to apply it to a directory and everything inside.
  • Access control lists. Systems using ACLs or SELinux can allow or deny access beyond what the nine permission bits show.

How to use it

  1. 1

    Tick or clear the three owner boxes: Owner — read, Owner — write and Owner — execute.

  2. 2

    Do the same for the Group boxes, then for the Other boxes, which cover every user who is neither the owner nor in the group.

  3. 3

    Type the file or directory in Path so the command is built for it. Left blank, the command uses file.txt.

  4. 4

    Read Octal and Symbolic in the Permissions panel, with the per-class breakdown for Owner, Group and Other beside them.

  5. 5

    Copy the line under Command and run it in a terminal. Put quotes around the path yourself if it contains spaces.

Answers to common questions

What is the difference between owner, group and other?
Every file has one owning user and one owning group. The owner digit applies to that user, the group digit to members of that group who are not the owner, and the other digit to everybody else. The system checks them in that order and uses the first class that matches.
What is the difference between chmod 755 and 775?
Only the group digit. With 755 the group can read and execute; with 775 the group can also write. Use 775 on a directory when several people in one group need to create and delete files in it, and 755 when only the owner should.
What does chmod +x do?
It adds the execute bit without touching read or write. With no letter in front, it adds execute for owner, group and other, limited by your umask. chmod u+x adds it for the owner alone. On a file at 644, chmod +x normally produces 755.
How do I see the current permissions of a file?
Run ls -l and read the first column, for example -rw-r--r--. The first character is the type (- for a file, d for a directory, l for a link) and the next nine are the symbolic permissions. On Linux, stat -c %a file prints the octal number directly.
What permissions do new files get by default?
It depends on the umask. With the common umask of 022, new files are created as 644 and new directories as 755. A umask of 002 gives 664 and 775, and 077 gives 600 and 700.
Does chmod work on Windows?
Not on native Windows file systems, which use access control lists instead of the owner, group and other model. chmod does work inside WSL, in Git Bash to a limited extent, and on macOS, Linux, BSD and any other Unix-like system.
Why do I get permission denied after setting 644 on a script?
644 has no execute bit, so the shell will not run the file directly. Either set it to 755, or keep 644 and pass the file to its interpreter, for example bash script.sh.

Further reading

Looking for something else? Browse all developer tools or see every tool.