How to use Chmod Calculator
- Set what the owner, the group and everyone else may do with the file.
- Watch the octal mode and the symbolic form update under the result.
- If you already have a mode, type it into the octal field instead, for example 640, and read it back.
- Copy the finished chmod command when you are ready to change a real file.
Example: Chmod Calculator
Work out the mode for a configuration file only its owner should change.
Options
- Three-digit and four-digit modes
- The result shows the familiar three digits, such as 644, and the four-digit form with a leading zero, such as 0644. The page does not set the setuid, setgid or sticky bits, so that leading digit stays 0.
- Reading a mode back
- Type a mode into the octal field and the page explains each digit: 7 is read, write and execute, 5 is read and execute, 4 is read only, and 0 is no access at all.
Supported inputs and limits
Where your input is processed
This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.
How nine bits turn into one octal digit
Each class gets three bits: read is worth 4, write is worth 2 and execute is worth 1. Add the bits a class holds and you get a digit from 0 to 7, which is why 6 means read and write without execute, and 5 means read and execute without write. Three digits cover the owner, the group and everyone else, and the symbolic form spells the same sums out as r, w and x with a dash where a permission is missing. Directories reuse the execute bit to mean enter, which is why a directory usually needs it even when nothing in it is ever run.
Questions about Chmod Calculator
What does 755 mean?
The owner may read, write and execute, and the group and everyone else may read and execute. It is the usual mode for a directory, or for a program other people should be able to run but not change.
Is 777 ever the right answer?
It grants read, write and execute to everyone. On a shared server that lets any account rewrite the file, so it is rarely correct outside a temporary file in a sandbox you control.
Why does the symbolic mode start with a dash?
The first character is the file type: a dash for an ordinary file, d for a directory. The nine characters after it are the owner, group and other permissions in that order.
Does calculating a mode change my file?
No. The page works out the number and shows a command you can copy. Nothing is read from or written to disk, and no server sees the result.
What is the fourth digit for?
The leading digit carries setuid, setgid and sticky. This page keeps it at zero and prints it so the mode lines up with tools that show four digits. Set those bits deliberately, because they change which user a program runs as.