Advertisement

Free Online Chmod Calculator

Build Unix file permissions and copy chmod values.

Owner

Group

Others

Special bits

Octal
Symbolic
Command

Owner: read, write, execute · Group: read, execute · Others: read, execute

Octal digits add read (4), write (2), and execute (1). The optional leading digit adds setuid (4), setgid (2), and sticky (1).

Permission explanation

Who Permission Symbol Meaning State
Advertisement

About the Chmod Calculator

Unix and Linux file permissions are stored as a bitmask. Every file and directory has three permission sets: owner, group, and others. Each set contains read, write, and execute bits. This calculator lets you toggle those bits and immediately see the octal number, the symbolic form, and the exact chmod command to use. It also supports the three special bits: setuid, setgid, and sticky.

How the numbers work

  • Read (r): value 4. View a file's contents, or list a directory.
  • Write (w): value 2. Modify a file, or create and delete entries in a directory.
  • Execute (x): value 1. Run a program, or enter a directory and access paths inside it.
  • Octal: add the values for each set. For example, 7 is read + write + execute, 6 is read + write, and 5 is read + execute.
  • Special bits: setuid (4), setgid (2), and sticky (1) form an optional fourth digit, so 4755 means setuid plus 755.

The symbolic form has ten positions: a file type character followed by three groups of three. The first character is - for a regular file, d for a directory, and l for a symbolic link. Each group then shows r, w, and x when allowed, or a hyphen when denied. When setuid or setgid is combined with execute, the execute slot becomes a lowercase s; with sticky it becomes t. If the special bit is set but execute is not, the letter is uppercase (S or T), which is a common source of confusion.

Setuid makes an executable run with the file owner's user ID, while setgid runs it with the group ID. Setgid on a directory makes new files inherit the directory's group, and sticky on a directory prevents users from deleting files they do not own. Special bits are powerful, so apply them deliberately. Permissions shown here are the mode you pass to chmod, not the full context of ACLs, mount options, or SELinux policy.

How to use this tool

  1. Tick read, write, and execute for owner, group, and others.
  2. Add setuid, setgid, or sticky if the situation requires them.
  3. Read the octal and symbolic results, then copy the command.
  4. Check the explanation table to confirm each enabled bit.

Frequently asked questions

What is the most common permission mode?

755 is typical for directories and executables, and 644 is typical for regular files. Neither grants write access to group or others.

Why does the symbolic value start with a dash?

The first character describes the file type. A dash means a regular file. Directories usually show d and symbolic links show l.

Is 777 a good idea?

Usually not. It lets every user read, write, and execute the item. Use the minimum permissions needed, and prefer group ownership over world-writable modes.

Sponsored
Find a bug? Report now