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
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
| Mode | Symbolic | Who can do what | Typical use |
|---|---|---|---|
| 644 | -rw-r--r-- | Owner reads and writes; group and others read | Ordinary files: web pages, documents, config files |
| 600 | -rw------- | Owner reads and writes; nobody else has access | Private files such as keys and password files |
| 640 | -rw-r----- | Owner reads and writes; group reads; others nothing | Config or log files that one group must read |
| 664 | -rw-rw-r-- | Owner and group read and write; others read | Files a team edits together |
| 400 | -r-------- | Owner reads only | Files that should not be changed by accident |
| 755 | -rwxr-xr-x | Owner reads, writes and runs; others read and run | Programs, scripts and directories |
| 700 | -rwx------ | Owner only | Private scripts and directories |
| 750 | -rwxr-x--- | Owner full; group reads and runs; others nothing | Programs or directories for one group |
| 775 | -rwxrwxr-x | Owner and group full; others read and run | Directories a team writes to |
| 777 | -rwxrwxrwx | Everyone reads, writes and runs | Avoid: the calculator shows a warning |
| 4755 | -rwsr-xr-x | 755, and the program runs with its owner’s user ID | Programs that need their owner’s rights, reviewed first |
| 2755 | -rwxr-sr-x | 755, and setgid | Directories whose new files take the directory’s group |
| 1777 | -rwxrwxrwt | 777, and the sticky bit | Shared 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
| Digit | Permissions | Meaning |
|---|---|---|
| 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 |
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 toolsJSON Formatter
Paste JSON to format it with 2 spaces, 4 spaces or tabs, minify it or sort its keys. A syntax error is reported with its line, column and a caret under it.
JSON Path Query Tool
Test a JSONPath expression on your JSON and see the match count, each matching value and its path. Filters such as ?(@.price < 10) work. Up to 100 KB.
Base64 Converter
Encode text to Base64 or decode Base64 to text. UTF-8, standard and URL-safe alphabets, optional padding on decode, up to 250,000 characters.
URL Encoder/Decoder
Percent-encode or decode text as you type: one value with encodeURIComponent or a whole URL with encodeURI, and an option to read + as a space.
UUID Generator
Generate 1 to 1,000 random v4 UUIDs, or time-based v1, or name-based v5 and v3 from a namespace and a name, and copy them. Repeats of v4 are very unlikely.
ULID Generator
Generate 1 to 500 ULIDs, 26-character IDs that sort by creation time, in upper or lower case, and decode any ULID to the date it was made.