chmod Calculator

Calculate Unix file permissions visually

What is chmod?

chmod (short for “change mode”) is a core Unix and Linux command used to change the access permissions of files and directories. Every file on a Unix-like system has three sets of permissions controlling access for the file’s owner, its group, and all other users.

Permissions were part of the original Unix design in the 1970s and remain the cornerstone of file security on Linux, macOS, BSD, and every other Unix-like operating system. Understanding chmod matters for system administration, web development, deployment, and security. This calculator converts between the two ways of writing permissions — numeric (octal) like 755 and symbolic like rwxr-xr-x — so you never have to do the math by hand.

Permission Types

Each file has three types of access:

  • Read (r = 4): View file contents or list directory contents
  • Write (w = 2): Modify or delete the file, or add/remove files in a directory
  • Execute (x = 1): Run the file as a program, or enter (cd into) a directory

These are assigned independently to three categories of users:

  • Owner (u): The user who owns the file
  • Group (g): Users in the file’s group
  • Others (o): Everyone else

Numeric (Octal) Notation

The numeric system uses three digits, one per category. Each digit is the sum of permission values:

PermissionValue
Read (r)4
Write (w)2
Execute (x)1
None (-)0

For example, chmod 755 means:

  • Owner: 7 (4+2+1) = rwx (read, write, execute)
  • Group: 5 (4+0+1) = r-x (read, execute)
  • Others: 5 (4+0+1) = r-x (read, execute)

Because each digit is a sum of 4, 2, and 1, every digit from 0 to 7 maps to exactly one combination of rwx — that is why octal notation is so compact.

How to Read ls -l Output

When you run ls -l, each line begins with a 10-character permission string such as -rwxr-xr-x. Reading it left to right:

-  rwx  r-x  r-x
│   │    │    └── others  (r-x = 5)
│   │    └─────── group   (r-x = 5)
│   └──────────── owner   (rwx = 7)
└──────────────── file type

The first character is the file type, not a permission:

  • - regular file
  • d directory
  • l symbolic link
  • c / b character or block device
  • s socket, p named pipe

So -rwxr-xr-x is a regular file with mode 755, and drwxr-xr-x is a directory with the same permissions.

How to Use This Tool

  1. Click the checkboxes to toggle read, write, and execute for each category
  2. Or enter a numeric value (like 755) to see the visual breakdown
  3. Read the numeric code and symbolic representation
  4. Copy the ready-to-run chmod command

Common Permission Values

NumericSymbolicTypical Use
777rwxrwxrwxFull access for everyone (dangerous)
755rwxr-xr-xExecutable files, directories, scripts
750rwxr-x—Group-restricted executables
644rw-r–r–Regular files (web content)
640rw-r—–Group-readable config files
600rw——-Private files (SSH keys, configs)
400r——–Read-only private files

chmod 755 vs 644 vs 777

These three are by far the most common values, and choosing between them trips up a lot of developers:

  • 755 (rwxr-xr-x) — use for directories and executable files (shell scripts, binaries, CGI). Everyone can read and traverse, but only the owner can change the contents. Directories almost always need the execute bit, otherwise no one can cd into them.
  • 644 (rw-r--r--) — use for regular, non-executable files: HTML, CSS, JavaScript, images, .txt, and most uploads. The owner edits, everyone else reads. Giving these files 755 needlessly marks them executable.
  • 777 (rwxrwxrwx) — avoid in almost all cases. A “quick fix” of chmod 777 to make an upload folder work usually just hides a real ownership problem and leaves the path world-writable. Prefer fixing the owner/group with chown and using 755/775.

Special Permissions: setuid, setgid, and the Sticky Bit

Beyond the three standard digits, Unix supports a fourth, leading octal digit for special behavior:

BitOctalSymbolEffect
setuid4000s (owner x)Runs the file with the owner’s privileges
setgid2000s (group x)Runs with the group’s privileges; on a directory, new files inherit its group
sticky1000t (others x)On a directory, only a file’s owner can delete or rename it

Examples you will actually encounter:

chmod 4755 program    # rwsr-xr-x — setuid (like /usr/bin/passwd)
chmod 2755 shared/    # rwxr-sr-x — setgid directory, group is inherited
chmod 1777 /tmp       # rwxrwxrwt — world-writable but sticky

The lowercase s/t appears when the underlying execute bit is set; an uppercase S/T means the special bit is on but execute is not — usually a mistake.

Symbolic Notation

Symbolic notation changes specific bits without recomputing the whole mode. It uses who (u, g, o, a), an operator (+ add, - remove, = set exactly), and the permissions:

chmod u+x file             # Add execute for owner
chmod g-w file             # Remove write for group
chmod o=r file             # Set others to read-only
chmod a+r file             # Add read for all (a = all)
chmod u=rwx,g=rx,o=r file  # Set every class at once (equals 754)

Symbolic mode is ideal when you want to say “just make this executable” (chmod +x script.sh) without caring about the rest of the bits.

Recursive chmod (and the -R 777 Trap)

The -R flag applies a mode to a directory and everything inside it:

chmod -R 755 mysite/

The classic mistake is chmod -R 777 on a web root to “fix permissions.” It makes every file and directory world-writable and executable, which is both a security hole and often still doesn’t solve the original problem. When directories and files need different modes, split them:

find . -type d -exec chmod 755 {} \;   # directories: traversable
find . -type f -exec chmod 644 {} \;   # files: read-only for others

This gives directories their required execute bit while keeping regular files non-executable.

Common chmod Errors and Fixes

  • Operation not permitted — you don’t own the file. Only the owner (or root) can change a file’s mode. Use sudo, or fix ownership first with chown.
  • Permission denied when running a script — the execute bit is missing. Run chmod +x script.sh, then ./script.sh.
  • chmod: cannot access 'file': No such file or directory — the path is wrong or the file was moved. Check with ls -l.
  • Changes have no effect — the file is on a filesystem that doesn’t store Unix permissions (FAT32, exFAT, NTFS USB drives, Windows paths under WSL /mnt, or many FTP/SMB shares). chmod silently does nothing there.
  • Still denied after chmod 777 — a parent directory likely lacks the execute bit (you need x on every directory in the path), or a security layer such as SELinux or AppArmor is blocking access. Widening permissions won’t help.

chmod vs chown

They are often confused. chmod changes what can be done (read/write/execute); chown changes who owns the file (user and group). If a web server can’t write to an upload folder, the real fix is usually chown to the correct service user plus a sane 775/644 — not chmod 777.

Best Practices

  • Principle of least privilege: Grant only the permissions that are needed
  • Never use 777: Full access for everyone is a security risk — fix ownership instead
  • Directories need execute: Without x, users can’t cd into or list a directory
  • Use 600 for sensitive files: SSH keys, database credentials, and config files with secrets
  • Set directory permissions to 755 and files to 644: the standard, safe web defaults
  • Check before changing: Use ls -la to view current permissions before modifying
  • Use groups wisely: Instead of opening permissions to “others”, add users to the file’s group

Frequently Asked Questions

What does chmod do?

chmod (change mode) is a Unix/Linux command that changes the access permissions of files and directories. Permissions control who can read, write, or execute a file.

What does 755 mean?

755 means the owner has read, write, and execute permissions (7), the group has read and execute permissions (5), and others have read and execute permissions (5). In symbolic form, this is rwxr-xr-x. It is the standard for directories and executable scripts.

What does 644 mean?

644 means the owner can read and write (6), while the group and others can only read (4). In symbolic form it is rw-r--r--. This is the standard permission for regular files such as HTML, CSS, images, and text documents that should not be executable.

What does 777 mean and why is it dangerous?

777 (rwxrwxrwx) grants read, write, and execute to everyone — the owner, the group, and all other users. Any user on the system can modify or delete the file, which is a serious security risk. Use the least permission that works (usually 644 or 755) instead.

What is the difference between numeric and symbolic chmod?

Numeric (octal) mode uses digits (e.g., 755) where each digit represents permissions for owner, group, and others. Symbolic mode uses letters (e.g., u+x, g-w, o=r) where r=read, w=write, x=execute and u/g/o/a target owner, group, others, or all.

What are setuid, setgid, and the sticky bit?

They are special permissions set with a fourth octal digit. setuid (4000) runs a file with its owner's privileges, setgid (2000) makes new files in a directory inherit its group, and the sticky bit (1000) lets only a file's owner delete it — used on shared directories like /tmp, which is chmod 1777.

How do I chmod a folder and everything inside it?

Use the recursive flag: chmod -R 755 myfolder. Be careful — applying one mode to everything can make data files executable or over-expose them. It is usually safer to set directories and files separately with find, for example: find . -type d -exec chmod 755 {} \; and find . -type f -exec chmod 644 {} \;.

Why do I get 'Operation not permitted' when running chmod?

You can only change permissions on files you own (or as root). If you see 'Operation not permitted', you are not the owner — run the command with sudo or ask the file's owner. On FAT/exFAT/NTFS drives and some network shares, Unix permissions are not supported and chmod has no effect.

Is my data safe?

Yes. Permissions are calculated entirely in your browser. Nothing is sent to any server.