Chmod Calculator

Unix file permissions in numbers and letters.

Free tools that run in your browser. Nothing you type, open or create is uploaded to NerdBible or anyone else.

WhoReadWriteExecute
Owner (u)
Group (g)
Others (o)
Commands

    Common settings
    Common modes explained

    400 · 440 · 444 · 500 · 550 · 555 · 600 · 640 · 644 · 655 · 660 · 664 · 666 · 700 · 710 · 711 · 750 · 755 · 770 · 775 · 777 · 1777 · 2755 · 2775 · 4755

    The calculator follows the standard Unix and Linux permission model used by chmod, ls -l and FTP clients. It only does arithmetic in your browser; it cannot see or change any file.

    How to use it

    1. Tick the boxes for what the owner, the group and everyone else may do, or type a number such as 755 or letters such as rwxr-xr-x.
    2. Both forms stay in step, and the plain English line says what the setting allows.
    3. Copy the chmod command, with your file name, and run it on your server.

    Questions

    What do the three digits mean?

    Each digit is one class: owner, group, then everyone else. Read counts 4, write counts 2 and execute counts 1, and the digit is the sum. So 7 is read, write and execute, 5 is read and execute, and 4 is read only.

    What permissions should a website use?

    A common safe default is 644 for files and 755 for folders: you can change them, the web server can read them, and nobody else can write. Configuration files holding passwords are often set to 600 or 640. Avoid 777, which lets any user on the server change the file.

    What are setuid, setgid and the sticky bit?

    They are the optional fourth digit at the front. Setuid (4) runs a program as its owner, setgid (2) runs it as its group or makes new files in a folder inherit the folder group, and the sticky bit (1) on a shared folder such as /tmp stops users deleting each other's files. They show as s, s and t in place of x.

    What does a capital S or T mean in ls output?

    The special bit is set but the matching execute bit is not. A capital S on a file usually means a mistake, because setuid has no effect on a file that cannot be run.

    About this tool

    About the chmod calculator

    Unix and Linux decide who can read, write and run each file with a set of permission bits. They can be written as a number such as 755 or as letters such as rwxr-xr-x. This calculator converts between the two, says in plain English what the setting allows, and gives the chmod command to run.

    How the numbers work

    There are three digits, for the owner, the group and everyone else. Within each, read counts 4, write counts 2 and execute counts 1, and the digit is the sum:

    • 7 = read, write and execute
    • 6 = read and write
    • 5 = read and execute
    • 4 = read only

    Common settings for websites

    644 for files and 755 for folders is the usual safe default: you can change them, the web server can read them and nobody else can write. Configuration files holding passwords are often 600 or 640. Avoid 777, which lets any user or compromised process on the server change the file.

    Special bits

    An optional fourth digit at the front sets setuid (4), setgid (2) and the sticky bit (1). A capital S or T in ls output means the special bit is set without the matching execute bit, which on a file is usually a mistake.

    The calculator only does arithmetic in your browser; it cannot see or change any file.

    Related tools