Home › Developer Tools › Chmod Calculator

Chmod Calculator

Work out Linux file permissions in seconds: tick the boxes or type an octal value like 755, symbolic text like rwxr-xr-x, or an expression like u+x, and copy the ready chmod command. Everything is calculated in your browser.

WhoRead 4Write 2Execute 1Value
Owner u 0
Group g 0
Others o 0
Special bits

755 -rwxr-xr-x
    Numeric chmod 755 file.txt
    Symbolic chmod u=rwx,g=rx,o=rx file.txt
    Common permissions
    Advertisement

    How to use the Chmod Calculator

    1. Tick the boxes for read, write and execute for the owner, the group and others, or press a preset such as 644 or 755.
    2. Or type a value: an octal number (755, 0644, 4755), an ls -l string (-rw-r--r--) or an expression (u+x,g-w).
    3. Add special bits (setuid, setgid, sticky) if you need them; the fourth octal digit appears automatically.
    4. Enter the file or folder name, choose whether to apply it recursively, and read the plain-English summary.
    5. Copy the chmod command and run it in your terminal.

    Permission values at a glance

    OctalBinarySymbolicMeaning
    0000---No access
    1001--xExecute only
    2010-w-Write only
    3011-wxWrite and execute
    4100r--Read only
    5101r-xRead and execute
    6110rw-Read and write
    7111rwxRead, write and execute

    Common chmod values and where to use them

    Models -lTypical use
    644-rw-r--r--Web pages, images, documents, most config files
    755-rwxr-xr-xScripts and binaries; directories on web servers
    600-rw-------SSH private keys, .env files, password files
    700drwx------~/.ssh and other private directories
    640-rw-r-----Configs readable by a service group (e.g. www-data)
    775 / 664drwxrwxr-x / -rw-rw-r--Folders and files shared by a team group
    1777drwxrwxrwt/tmp: everyone can write, only owners can delete
    2775drwxrwsr-xShared project folder where new files keep the group
    4755-rwsr-xr-xsetuid programs such as passwd (use with great care)

    Read, write and execute on directories

    On a directory the same bits mean something different: read lets you list the names inside, write lets you create, delete and rename entries (together with execute), and execute lets you enter the directory and access files by name. That is why folders almost always need x wherever they have r, and why 644 on a directory makes its contents unreachable.

    New files get their starting permissions from the umask: with the common umask 022, files are created as 644 and directories as 755. Symbolic expressions are handy for small changes without recalculating: chmod u+x script.sh adds execute for the owner, chmod go-w file removes write for group and others, and chmod -R a+rX dir makes a tree readable while adding execute only to directories.

    Frequently asked questions

    What does chmod 755 mean?

    755 gives the owner read, write and execute (7 = 4 + 2 + 1) and gives the group and everyone else read and execute (5 = 4 + 1). In symbolic form it is rwxr-xr-x. It is the usual mode for scripts, programs and directories that others need to open.

    What does chmod 644 mean?

    644 is rw-r--r--: the owner can read and write, the group and others can only read. It is the standard mode for ordinary files such as HTML pages, images and documents.

    How are octal permissions calculated?

    Each digit is the sum of read = 4, write = 2 and execute = 1 for one class of users: the first digit is the owner, the second the group and the third others. An optional leading digit adds setuid = 4, setgid = 2 and sticky = 1, so 4755 is 755 plus setuid.

    What do s, S, t and T mean in ls -l output?

    A lowercase s in the owner or group execute position means setuid or setgid is set and execute is also set. An uppercase S means the special bit is set without execute. Likewise, t in the others position is the sticky bit with execute, and T is sticky without execute.

    Should I use chmod 777?

    Almost never. 777 lets every user on the system read, modify and execute the file or create and delete files in the folder. Web hosts and security scanners flag it. Use 755 for directories and 644 for files, and give write access only to the owner or a specific group.

    What permissions should an SSH private key have?

    OpenSSH refuses private keys that others can read. Use chmod 600 (or 400) on the key file and chmod 700 on the ~/.ssh directory.

    Does chmod -R apply the same mode to files and folders?

    Yes, which is why chmod -R 755 also makes every file executable. A common alternative is to use find: find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} +, or a symbolic mode with capital X (a+rX), which adds execute only to directories and files that are already executable.

    Related tools