Skip to content
Toolew.com

Chmod Calculator

Calculate Linux file permissions: tick read, write and execute boxes and get octal, rwx notation and ready-to-run chmod commands.

Runs in your browser. Your data is not uploaded.
Loading tool…

This guide is not yet available in your language and is shown in English.

Tool guide

What this tool does

Chmod Calculator converts Unix permissions between a checkbox grid, octal numbers such as 755 or 2775, ls -l notation such as rwxr-xr-x and chmod expressions such as u+x,go-w. It covers setuid, setgid and the sticky bit, explains risky settings, generates chmod and find commands and works out default permissions from a umask.

Every file and directory on Linux, macOS and other Unix-like systems carries nine permission bits, read, write and execute for the owner, the group and everyone else, plus three special bits. They are written either as octal digits, where read is 4, write 2 and execute 1, or as the rwx string shown by ls -l. Getting them wrong either breaks a deployment with “Permission denied” or leaves secrets readable by every user on the server.

This calculator keeps all notations in sync. Tick boxes and the octal and symbolic values update; type 640 or rw-r----- and the boxes follow. A fourth leading octal digit sets setuid (4), setgid (2) and the sticky bit (1), shown as s, s and t in the execute positions, or as capital S and T when execute is missing. You can apply symbolic chmod expressions with the same rules as GNU chmod, including the conditional X. Nothing runs on a server; the tool only builds commands for you to copy.

How to use Chmod Calculator

  1. Tick Read, Write and Execute for Owner, Group and Others, or click a preset such as 644 or 755.
  2. Alternatively, type an Octal value or a Symbolic (ls -l) string to load existing permissions.
  3. Enter a chmod expression such as u+x,go-w under Apply a chmod expression and press Enter.
  4. Set Target is a to File or Directory, which affects the X permission and the ls -l type letter.
  5. Enter the File or directory path and copy the generated chmod, recursive or find command.
  6. Use the umask calculator to see what permissions new files and directories will get.

Tips for better results

  • Use 644 for regular files and 755 for directories and executables on web servers; directories need execute for anyone to enter them.
  • Apply different modes to files and directories with find … -type f and find … -type d instead of chmod -R, which gives both the same bits.
  • SSH refuses private keys that others can read; set them to 600 and the ~/.ssh directory to 700.
  • A umask of 022 gives new files 644 and new directories 755; 027 gives 640 and 750, which hides files from other users.

Common use cases

  • Fixing “Permission denied” errors after uploading a website or deploying an application.
  • Locking down SSH keys, .env files and database credentials.
  • Setting up shared project directories with setgid so new files keep the team group.
  • Translating between rwx strings in ls -l output and the octal numbers documentation asks for.

Common mistakes to avoid

  • Using 777 to make an error go away. It lets any user or compromised process change the files; fix the owner with chown instead.
  • Running chmod -R 644 on a directory tree, which removes execute from directories so nobody can open them.
  • Expecting setuid to work on shell scripts. Linux ignores setuid on interpreted scripts for security reasons.

Frequently asked questions

What does chmod 755 mean?

The owner can read, write and execute (7 = 4 + 2 + 1); the group and others can read and execute (5 = 4 + 1). In ls -l notation it is rwxr-xr-x.

What is the difference between s and S?

A lowercase s means setuid or setgid is set together with execute. A capital S means the special bit is set but execute is not, which is usually a mistake because the bit then has no useful effect.

What does the sticky bit do?

On a directory, the sticky bit (1000, shown as t) lets users delete or rename only their own files, even if the directory is writable by everyone. /tmp uses mode 1777 for this reason.

How is a umask applied?

The umask removes bits from the default creation mode: 666 for files and 777 for directories. With umask 022, files get 666 minus write for group and others, which is 644.

Feedback & suggestions

Help us improve Chmod Calculator. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.