Chmod Calculator - Convert Linux File Permissions

Tools / Dev Tools / Chmod Calculator

Chmod calculator

Owner 7
Group 5
Others 5
Special bits

setuid runs a program with its owner’s rights. setgid on a folder gives new files the folder’s group. sticky lets only a file’s owner delete it from a shared folder like /tmp.

chmod 755 file
chmod u=rwx,g=rx,o=rx file
ls -l -rwxr-xr-x
Common values

How chmod permissions work

Every file and folder on Linux and macOS has three sets of permissions: one for its owner, one for its group and one for everyone else. Each set is read, write and execute. chmod changes them, either with a number such as 755 or with letters such as u=rwx,g=rx,o=rx. Both describe the same thing, and this calculator turns one into the other.

How to use it

  1. 1 Start from whatever you have: tick the boxes, type a number like 644, or paste the letters from ls -l such as -rw-r--r--.
  2. 2 The other two fields follow instantly. The big digit above each column shows how that class adds up: read 4 + write 2 + execute 1.
  3. 3 Type your file or folder name and copy the command you prefer. The numeric form sets all bits at once; the letter form is easier to read in scripts.

Reading the three digits

Each digit is one class: owner, group, others, in that order. Inside a digit, read is 4, write is 2 and execute is 1, so 7 = rwx, 6 = rw-, 5 = r-x and 4 = r--. 755 is therefore not a quantity; it is three separate answers. That is also why 8 and 9 never appear: no combination of 4, 2 and 1 goes above 7.

Folders need execute too

On a folder the letters mean something else. Read lets you list the names inside, write lets you create, rename and delete entries, and execute lets you enter the folder and open anything in it. A folder set to 644 shows its file names but refuses to open any of them, which is why web folders use 755 while the files inside use 644. Running chmod -R 755 on a whole site makes every file executable as well; chmod -R u=rwX,go=rX is safer, because capital X adds execute only to folders and to files that were already executable.

setuid, setgid and sticky: the fourth digit

A fourth digit in front holds the special bits: 4 for setuid, 2 for setgid, 1 for sticky, so 4755 is 755 plus setuid. In the letters they take the place of an x. A lowercase s or t means the special bit and execute are both on; an uppercase S or T means the special bit is on but execute is off, which is almost always a mistake, because a setuid program nobody can run does nothing. /tmp is the classic 1777 (rwxrwxrwt), and passwd is the classic 4755 (rwsr-xr-x).

Why 777 is the wrong fix

When an upload or a cache folder fails with "permission denied", 777 makes the error go away because it gives write access to every account on the machine. On a shared or compromised server that means any process can replace your scripts with its own code. The real fix is usually ownership: make the web server user the owner (chown) or put it in the group and use 775 for folders and 664 for files. New files get their starting permissions from the umask; the common umask 022 turns 666 into 644 for files and 777 into 755 for folders.

Chmod calculator - frequently asked questions

The owner can read, write and execute (7 = 4 + 2 + 1), while the group and everyone else can read and execute but not change anything (5 = 4 + 1). In letters it is rwxr-xr-x, or u=rwx,g=rx,o=rx. It is the usual setting for folders and for scripts that other users need to run.
New
Subnet Calculator Enter an IPv4 address with a CIDR prefix or netmask to get the network and broadcast address, usable host range, host count, wildcard and binary view.
Popular Today
MD5 Hash Generator Free MD5 hash generator: turn any text or file into an MD5 checksum in your browser - useful for integrity checks and quick fingerprinting.

Related Dev Tools

MD5 Hash Generator Free MD5 hash generator: turn any text or file into an MD5 checksum in your browser - useful for integrity checks and quick fingerprinting.
Base64 Encoder & Decoder Free Base64 encoder and decoder: convert text or files to Base64 and back, entirely in your browser - nothing is uploaded to a server.
JWT Decoder Free JWT decoder: paste a token to read its header, payload and signature in a readable form - decoding happens in your browser, nothing is sent.
URL Encoder & Decoder Free URL encoder and decoder: convert links and query parameters to percent-encoding and back, with full-URL and component modes, in your browser.
UUID Generator Free UUID generator: create v1, v4 and v5 identifiers instantly, generate them in bulk and copy any value with a single click - no signup needed.

Other Tools You May Like

Word to PDF Convert Word to PDF for free: upload a DOC, DOCX, ODT or RTF file and download a properly formatted PDF in seconds - no registration or watermark.
PDF to Word Convert PDF to Word for free: upload a PDF and download an editable DOCX in seconds - no registration, no watermark and nothing to install.
Word Counter Free word counter: paste any text to count words, characters, sentences and paragraphs, and see the estimated reading time - nothing leaves your browser.
Character Counter Free character counter: count characters with and without spaces, plus words and lines, and check SEO limits for titles and meta descriptions.
Keyword Density Checker Free keyword density checker: paste text or a URL to see how often each word and phrase appears, with percentages for one, two and three-word terms.