Chmod Calculator Guide: 755 and rwxr-xr-x Explained

Last updated: · 3 min read

On Linux and macOS, three permission sets decide who can read, write or run a file: the owner, the group and everyone else. The chmod command changes them either with an octal number such as 755 or with letters such as rwxr-xr-x. Converting between the two looks confusing at first, but once the rule is clear each digit can be read on its own. This guide shows how permission numbers are built and what the special bits (setuid, setgid and sticky) do, using a worked example. The outputs come from the Chmod Calculator tool.

Formula

For each digit (owner, group, others):
  read (r) = 4,  write (w) = 2,  execute (x) = 1
  digit = sum (for example rwx = 7, r-x = 5, --- = 0)

Special bits, in an optional fourth leading digit:
  setuid = 4,  setgid = 2,  sticky = 1

Symbolic to numeric: add the r, w and x values of each group; setuid is shown as s in the owner part, setgid as s in the group part, and sticky as t in the others part.

The format is defined in the POSIX chmod specification. A three-digit number sets the three permission groups, and a four-digit number adds the special bit in front. The execute bit on a directory means permission to enter it. The symbolic form (chmod u=rwx,g=rx,o= file) spells out each group, and the numeric and symbolic forms describe the same permissions.

What the inputs mean

Permission (755 or rwxr-xr-x)
An octal number with three or four digits (for example 755 or 4755), or the nine-character symbolic form (for example rwxr-x---). A leading file-type character such as - is accepted.

Worked example: Working out permission 750

  1. Input: 750. The digits are owner = 7, group = 5 and others = 0.
  2. Owner 7 = 4 + 2 + 1, so read, write and execute. Output: Owner (user): read, write, execute.
  3. Group 5 = 4 + 1, so read and execute. Output: Group: read, execute.
  4. Others is 0, so nothing is granted. Output: Others: no permissions.
  5. The letters are rwx r-x ---, and the commands are chmod 750 file, or in symbolic form chmod u=rwx,g=rx,o=- file.

Result: Tool output: Numeric: 750, Symbolic: rwxr-x---, Command: chmod 750 file, Symbolic command: chmod u=rwx,g=rx,o=- file.

🔐 Chmod Calculator

Free, no sign-up; your data stays in your browser.

Open the calculator →

How to read the result

For web server files, 644 (files) and 755 (directories) are common; configuration files that must stay private are often 600 or 640. Giving a file 777 lets everyone write to it and creates a security hole. These are general guidelines; check them against your own server's users and groups.

Common mistakes

  • Writing the digits separately instead of adding them. The digit 6 means read and write (4 + 2); its value comes from the sum.
  • Giving a directory and a file the same permission. Without execute on a directory nobody can enter it, while a file that never runs does not need x.
  • Forgetting the special bits. The difference between 4755 and 755 is the setuid bit, which makes the program run with the owner's rights.
  • Confusing o=- with o=. o=- means no permissions for others, while o= clears the permissions; the difference matters in the symbolic command.
  • Setting 777. Files that everyone can write are an easy target; grant only the smallest permission that works.

Frequently asked questions

Are 755 and rwxr-xr-x the same?

Yes. 7 = rwx, 5 = r-x and the last 5 = r-x, so the full form is rwxr-xr-x.

What is the fourth digit for?

The leading digit holds the special bits: 4 for setuid, 2 for setgid and 1 for sticky. Values such as 4755 use it; three-digit values such as 755 do not.

Does chmod change the owner?

No. chmod only changes permissions; use chown to change the owner.

Does this apply to Windows files too?

No. This format is for POSIX systems such as Linux, macOS and BSD. Windows uses access control lists (ACLs) instead.

The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.

Sources

Choose your cookie preference to continue

Records the site needs to work (theme, language, favourites) stay in your browser.

This site is free and funded by ads.

With your consent, Google Analytics cookies measure visits and Google AdSense cookies are used to show ads; the data is processed on Google servers abroad.

If you reject, the site works just the same.

Cookie Policy · KVKK notice