Chmod Calculator
Convert Linux file permissions between octal (755, 644) and symbolic (rwxr-xr-x) notation and see who can read, write and execute.
Was this tool helpful?
Thanks for the feedback!
This calculator converts Linux and Unix file permissions between octal numbers like 755 and symbolic strings like rwxr-xr-x. It shows a table of who can read, write and execute, explains any setuid, setgid or sticky bit, and gives you the chmod command to copy. It is aimed at developers, students and anyone setting permissions on shared hosting or a VPS.
What you can enter
The one field is Permission (octal like 755, or symbolic like rwxr-xr-x). It accepts:
- Three octal digits, such as
644, or four, such as0644or4755. Each digit must be 0 to 7. - Nine symbolic characters, such as
rw-r--r--. - The full ten-character string from
ls -l, such as-rw-r--r--ordrwxr-xr-x. The first character (file type) is dropped automatically.
How the octal digits work
Each of the three classes, owner, group and others, gets one digit made by adding: read = 4, write = 2, execute = 1. So 7 is rwx, 6 is rw-, 5 is r-x, 4 is r-- and 0 is ---. The tool shows this in a Read / Write / Execute table for Owner (user), Group and Others.
| Octal | Symbolic | Typical use |
|---|---|---|
| 644 | rw-r--r-- | ordinary files: HTML, PHP, images, CSS |
| 755 | rwxr-xr-x | folders, and scripts that need to run |
| 600 | rw------- | private files like SSH keys and config with passwords |
| 640 | rw-r----- | config files the web server group must read |
| 777 | rwxrwxrwx | everyone can do everything (avoid) |
For a folder, "execute" means permission to enter it and reach the files inside, which is why folders need the x bit even when files do not.
Setuid, setgid and the sticky bit
A fourth, leading digit holds the special bits: setuid = 4, setgid = 2, sticky = 1. In symbolic form they replace the x in one of the three groups:
- Setuid shows as
sin the owner's execute spot. A program with setuid runs with its owner's rights. Typingrwsr-xr-xgives chmod 4755, and the table marks the owner row "Yes + setuid". Thepasswdcommand is the classic example. - Setgid shows as
sin the group's execute spot. On a folder, new files inherit the folder's group, which helps teams share a directory. 2775 shows asrwxrwsr-x. - Sticky shows as
tin the others' execute spot. In a sticky folder, users can only delete their own files. 1777 shows asrwxrwxrwt, the usual mode of/tmp.
A capital S or T means the special bit is set but the execute bit underneath is not. For example, rwSr--r-- converts to 4644. On a file that cannot be executed, setuid does nothing, so a capital S usually points to a mistake.
Safe defaults for a website
On most Linux web hosting, 644 for files and 755 for folders is the standard advice. The owner can edit, and the web server can read files and enter folders, but other accounts cannot change anything. For files holding database passwords, such as .env or wp-config.php, 600 or 640 is tighter where your host supports it.
Whenever "others" have write permission, the tool adds a warning: "others" can write to this file. You will see it for 777, 666 and also 1777. Setting 777 to fix an upload error is a common shortcut, but it lets any process on the server change the file, which is how many hacked sites get altered. Find out which user the web server runs as and fix ownership instead.
Using the command
The result includes a ready line such as chmod 755 filename with a Copy button. Replace filename with your file or folder. If you entered a leading zero, the tool drops it, so 0640 becomes chmod 640. Add -R to apply a mode to a folder and everything in it, but be careful: running chmod -R 755 makes every file executable too. Many people use find to set folders and files separately.
Inputs with digits 8 or 9, or symbols in the wrong place, give the message "Enter an octal mode like 755 or 0644, or a symbolic one like rwxr-xr-x." To convert between octal, binary and decimal more generally, use the number base converter.
Frequently asked questions
What does chmod 755 mean?
What is the difference between 644 and 755?
Is chmod 777 safe?
What does the s in rwsr-xr-x mean?
What is the sticky bit used for?
How do I convert -rw-r--r-- to octal?
Related guides
- chmod 755 vs 644: Linux File Permissions Explained, with Octal and Symbolic Examples chmod 755 gives the owner read, write and execute and everyone else read and execute; 644 drops execute. How octal permissions work, with a table of c...
- Free Developer Tools That Replace a Dozen Browser Tabs Free developer tools grouped by job: format, convert, encode, generate and test. What each one does, which run on the server, and the limits to know f...
- How to Beautify CSS, HTML and XML (Online, VS Code, Prettier) Beautifying adds line breaks and indentation so minified CSS, HTML or XML is readable again. How the free formatters work, their limits, and VS Code a...