What chmod does
On Linux and macOS every file has permissions that say who may read, write or execute it. The chmod command changes them. Permissions are written either as a three or four digit octal number, such as 755, or as letters, such as rwxr-xr-x. This calculator lets you tick the permissions you want and shows both forms plus the ready-to-run command.
How the numbers work
Each permission has a value, and you add them for each group (owner, group, others):
read (r) = 4
write (w) = 2
execute (x) = 1
7 = 4+2+1 = rwx
6 = 4+2 = rw-
5 = 4+1 = r-x
4 = 4 = r--
0 = ---How to use it
- Tick read, write and execute for the owner, the group and others.
- Or type an octal value such as 644 and see the boxes update.
- Enter the file or folder name and, if needed, tick recursive.
- Copy the chmod command.
Permissions you will use most
- 755 (rwxr-xr-x): programs, scripts and folders that others may enter and run.
- 644 (rw-r--r--): ordinary files that everyone may read but only the owner may edit.
- 600 (rw-------): private files such as SSH keys.
- 700 (rwx------): private folders.
- 777 gives everyone full access. Avoid it. It is rarely needed and is a common security mistake.
Special bits
- Setuid (4): the file runs with the permissions of its owner.
- Setgid (2): runs with the group of the file, or makes new files in a folder inherit the folder group.
- Sticky (1): in a shared folder such as /tmp, only a file owner may delete it. Example: 1777.
Related tools
- CIDR & Subnet Calculator: Calculate network, broadcast, masks and host range for any IPv4 CIDR block and check if an IP is inside it.
- Regex Tester & Generator: Test, validate, and debug regular expressions in real-time with our 100% client-side tool.
- Cron Expression Generator: Build and explain 5-field cron expressions in plain English and preview the next run times.
- Secure Password Generator: Generate strong, random passwords with customizable length and character sets.
