Skip to main content
CalcChef

Chmod Calculator

Type a chmod mode such as 755 or 4755 to see rwxr-xr-x, or paste rwxr-xr-x or tick read, write and execute for owner, group and public to get the octal number. How it works

Use the Chmod Calculator

Type a mode such as 644, or tick the boxes below: the two stay in step.

Paste rwxr-xr-x or an ls -l string such as -rwsr-xr-x: s and t set the special bits.

Owner
Group
Public
Special bits

A name with spaces or shell characters is quoted for you. Leave it empty to print file.

Options
Symbolic expression (chmod u+x)
Who
Operator

Applied to 755, u+x gives 755.

Octal
755
Symbolic -rwxr-xr-x
chmod 755 file
chmod u=rwx,g=rx,o=rx file
chmod u+x file

About the Chmod Calculator

chmod 755 means rwxr-xr-x: the owner can read, write and execute (7 = 4 + 2 + 1), and the group and everyone else can read and execute (5 = 4 + 1). Each octal digit adds read 4, write 2 and execute 1 for owner, group and public, in that order, and an optional fourth digit in front sets setuid (4), setgid (2) or the sticky bit (1).

Common chmod modes and what they allow

ModeSymbolicWho can do whatTypical use
644-rw-r--r--Owner reads and writes; group and others readOrdinary files: web pages, documents, config files
600-rw-------Owner reads and writes; nobody else has accessPrivate files such as keys and password files
640-rw-r-----Owner reads and writes; group reads; others nothingConfig or log files that one group must read
664-rw-rw-r--Owner and group read and write; others readFiles a team edits together
400-r--------Owner reads onlyFiles that should not be changed by accident
755-rwxr-xr-xOwner reads, writes and runs; others read and runPrograms, scripts and directories
700-rwx------Owner onlyPrivate scripts and directories
750-rwxr-x---Owner full; group reads and runs; others nothingPrograms or directories for one group
775-rwxrwxr-xOwner and group full; others read and runDirectories a team writes to
777-rwxrwxrwxEveryone reads, writes and runsAvoid: the calculator shows a warning
4755-rwsr-xr-x755, and the program runs with its owner’s user IDPrograms that need their owner’s rights, reviewed first
2755-rwxr-sr-x755, and setgidDirectories whose new files take the directory’s group
1777-rwxrwxrwt777, and the sticky bitShared directories such as /tmp

Symbolic text as the calculator prints it, for a regular file; ls -l shows d in place of the first - for a directory. On a directory, read lists the names, write creates and removes files, and execute lets you reach the files inside. The setgid and sticky-bit uses are those the GNU coreutils manual gives for most systems.

One octal digit in rwx form

DigitPermissionsMeaning
0---No access
1--xExecute only
2-w-Write only
3-wxWrite and execute
4r--Read only
5r-xRead and execute
6rw-Read and write
7rwxRead, write and execute

Frequently asked questions

What does chmod 755 mean?
rwxr-xr-x. The owner can read, change and run the file; the group and everyone else can read and run it but not change it. It is the usual mode for programs, scripts and directories.
What is the difference between chmod 644 and 755?
755 adds execute (x) for all three classes. 644 (-rw-r--r--) suits files that are only read, such as web pages; 755 (-rwxr-xr-x) suits programs and directories, because a directory needs execute before you can reach the files in it.
Why is chmod 777 a bad idea?
777 (-rwxrwxrwx) lets every user on the system read, change and run the file. The calculator warns about it and suggests 755 for programs or 644 for data; any mode that lets others write gets a warning too. With -R ticked, 777 gets a second warning: set 755 on the directories and 644 on the files separately, with find . -type d and find . -type f. 1777, the mode of shared directories such as /tmp, gets its own note about the sticky bit instead.
What does the 4 in chmod 4755 mean?
A fourth, leading digit sets the special bits: 4 is setuid, 2 setgid and 1 the sticky bit. 4755 shows as -rwsr-xr-x, and a setuid program runs with its owner’s user ID whoever starts it. Without the owner’s execute bit the s becomes a capital S, as in 4644 (-rwSr--r--), and the calculator notes that setuid then has no effect.
What is chmod 1777?
777 plus the sticky bit, shown as -rwxrwxrwt. On a directory such as /tmp everyone can create files, but users cannot delete or rename files they do not own. The calculator still shows its 777 warning for 1777, because it checks only the last three digits and does not know whether you mean a file or a directory; on a shared directory with the sticky bit, 1777 is the normal mode.
How do I turn rwxr-xr-x into a number?
Add the values in each group of three, r = 4, w = 2 and x = 1: rwx = 7, r-x = 5, r-x = 5, so rwxr-xr-x is 755. Or paste rwxr-xr-x into the Symbolic mode field and read 755. A whole ls -l line works too, because only its first word is read, and s, S, t and T set the special bits: rwsr-xr-x is 4755.

Related Tools

View all tools