1. Home
  2. Code
  3. Chmod Calculator

Chmod Calculator

Work out Unix file permissions: tick read, write and execute, or type 755 or rwxr-xr-x, and get the chmod command.

What it is for?
Runs in your browser Free, no sign-up
ReadWriteExecute
Owner
Group
Others

What it is for?

Unix and Linux decide who may read, change or run a file with three sets of permissions: owner, group and others. This calculator converts between the checkboxes, the number form such as 755 and the letter form such as rwxr-xr-x, and gives you the chmod command. Change any of the three and the other two follow.

Reading 755

Each digit is the sum of read (4), write (2) and execute (1), for the owner, the group and everyone else in that order. 755 lets the owner change a file and everyone run or read it, which suits folders and scripts. 644 is the usual choice for ordinary files. A leading fourth digit sets setuid, setgid and the sticky bit.

Pasting from ls -l

You can paste the first column of ls -l output, such as -rw-r--r-- or drwxr-xr-x, into the symbolic field. The leading file type letter is ignored. Special bits show as s or t in the execute position: 4755 is rwsr-xr-x, and 1777, the usual mode of /tmp, is rwxrwxrwt. A capital S or T means the special bit is set without execute.

Common mistakes

  • On a folder, execute means permission to enter it. A folder set to 644 cannot be entered, not even by its owner.
  • 777 lets every user on the server change the file. It often hides a wrong owner; fixing the owner with chown is usually the better answer.
  • Private keys and files with passwords should be 600 or 400. SSH refuses a key that others can read.

The command uses the word file as a placeholder; replace it with your path. Everything is worked out in this tab.