Chmod Calculator

Calculate Linux file permissions visually. Toggle checkboxes, get numeric & symbolic notation instantly. No data leaves your browser.

0755
rwxr-xr-x
chmod 755 filename
Common Presets
Read (4)
Write (2)
Execute (1)
Owner (u)
Group (g)
Others (o)
Special Permissions
Permission Reference
Numeric Symbolic Description Common Use
777rwxrwxrwxFull access for everyoneTemporary dev, never production
755rwxr-xr-xOwner full, others read+executeDirectories, scripts, executables
750rwxr-x---Owner full, group read+execute, others noneGroup-accessible programs
700rwx------Owner full, no access for othersPrivate scripts, home directories
644rw-r--r--Owner read+write, others readHTML, CSS, JS, config files
640rw-r-----Owner read+write, group readLog files, shared configs
600rw-------Owner read+write onlySSH keys, .env, credentials
400r--------Owner read onlyCertificates, immutable configs
775rwxrwxr-xOwner+group full, others read+executeShared group directories
664rw-rw-r--Owner+group read+write, others readShared group files

What Is the chmod Command?

The chmod (change mode) command is used on Linux and Unix systems to set or modify the access permissions of files and directories. Every file on a Linux system has three permission categories — owner, group, and others — and each category can independently be granted read, write, and execute access. The chmod command accepts permissions in numeric (octal) notation like chmod 755 file.txt or symbolic notation like chmod u+rwx,g+rx,o+rx file.txt.

Understanding Numeric (Octal) Permissions

In numeric notation, each permission has a value: read = 4, write = 2, execute = 1. You add these values together for each category to get a single digit. Three digits represent owner, group, and others. For example:

  Permission    Value
  ─────────────────────
  Read    (r)     4
  Write   (w)     2
  Execute (x)     1
  ─────────────────────

  Example: 755
  Owner:  4+2+1 = 7 (rwx)
  Group:  4+0+1 = 5 (r-x)
  Others: 4+0+1 = 5 (r-x)

Symbolic Permission Notation

Symbolic notation uses letters to represent permissions: r (read), w (write), x (execute). The permission string has nine characters arranged as three groups of three: rwxr-xr-x. A dash (-) indicates the permission is not set. When displayed by ls -l, an additional leading character shows the file type (d for directory, - for regular file, l for symlink).

Special Permissions: Setuid, Setgid & Sticky Bit

Beyond the standard read, write, and execute permissions, Linux supports three special permission bits:

  • Setuid (4xxx): When set on an executable, the process runs with the file owner's privileges. For example, /usr/bin/passwd uses setuid to let regular users change their own passwords. Set with chmod u+s or chmod 4755.
  • Setgid (2xxx): On an executable, the process runs with the file's group. On a directory, new files automatically inherit the directory's group, which is useful for shared folders. Set with chmod g+s or chmod 2755.
  • Sticky Bit (1xxx): On a directory, only the file owner (or root) can delete or rename files within it. The classic example is /tmp, which has mode 1777. Set with chmod +t or chmod 1777.

Common Permission Scenarios

  • Web server files (HTML, CSS, JS): 644 — owner can edit, everyone can read.
  • Web server directories: 755 — owner can manage, others can list and traverse.
  • CGI / PHP scripts: 755 — must be executable by the web server.
  • SSH private keys: 600 — SSH refuses to use keys with broader permissions.
  • Shared project directory: 2775 — group can write, setgid ensures new files inherit group.
  • Temporary directory: 1777 — world-writable with sticky bit to prevent deletion by others.

chmod vs. chown vs. chgrp

chmod changes what actions can be performed on a file. chown changes who owns the file (user and/or group). chgrp changes only the group. Together, these three commands control all aspects of file access on Linux. For example, chown www-data:www-data file.html && chmod 644 file.html gives the web server ownership with standard read/write permissions.

Frequently Asked Questions

What does chmod 777 mean?

chmod 777 sets read, write, and execute permissions for the owner, group, and all other users. Each 7 is the sum of read (4) + write (2) + execute (1). This is the most permissive setting and is generally considered a security risk on production systems because any user on the system can read, modify, or execute the file.

What is the chmod command in Linux?

chmod (change mode) is a Linux and Unix command that changes the access permissions of files and directories. It accepts permissions in numeric notation (e.g., chmod 755 file.txt) or symbolic notation (e.g., chmod u+rwx,g+rx,o+rx file.txt). The command controls who can read, write, and execute a file.

What is the difference between chmod 755 and 644?

chmod 755 (rwxr-xr-x) gives the owner full permissions and lets the group and others read and execute. It is commonly used for directories and executable scripts. chmod 644 (rw-r--r--) gives the owner read and write access while the group and others can only read. It is the standard permission for regular files like HTML, CSS, and configuration files.

How do Linux file permissions work?

Linux file permissions are divided into three categories: owner (user who owns the file), group (users in the file's group), and others (everyone else). Each category can have read (r), write (w), and execute (x) permissions. In numeric notation, read = 4, write = 2, execute = 1. The three digits represent owner, group, and others respectively.

What are setuid, setgid, and sticky bit?

These are special permissions in Linux. Setuid (4) makes an executable run with the file owner's privileges. Setgid (2) on a file runs it with the group's privileges; on a directory, new files inherit the directory's group. Sticky bit (1) on a directory prevents users from deleting files they don't own. They are represented as a fourth octal digit prepended to the standard three (e.g., 1755).

What permissions should I use for web server files?

For web server files: use 644 (rw-r--r--) for regular files like HTML, CSS, JavaScript, and images. Use 755 (rwxr-xr-x) for directories and executable scripts like CGI or PHP files. Use 600 (rw-------) for sensitive configuration files containing passwords or API keys. Avoid 777 in production as it allows any user to modify your files.

Is this chmod calculator free to use?

Yes, this chmod calculator is completely free and runs entirely in your browser. No data is sent to any server. You can use it to calculate permissions, look up common presets, and learn about Linux file permissions without creating an account or installing anything.

Related Tools