chmod Calculator
Calculate Unix file permissions visually. Click checkboxes or type the octal/symbolic value — all fields update instantly.
Owner (u)
Group (g)
Others (o)
chmod 644 filename
How to Use the chmod Calculator
- Check the boxes to set read, write, and execute permissions for the Owner, Group, and Others.
- Or type directly — enter an octal value (like 755) in the Octal field, or a symbolic value (like rwxr-xr-x) in the Symbolic field. All other fields update automatically.
- Use a preset — click any preset chip above for the most common permission patterns.
- Copy the command — click "Copy Command" to copy the ready-to-use chmod command for your terminal.
Understanding Unix File Permissions
Every file and directory on a Unix or Linux system has three sets of permissions: one for the file owner (the user who created it), one for the owner's group, and one for others (all other users on the system). Each set contains three permission bits: read (r), write (w), and execute (x).
How Octal Permissions Work
Each permission set (owner, group, other) is represented as a single digit in base 8 (octal). The digit is calculated by summing the values of the active permissions:
- Read (r) = 4
- Write (w) = 2
- Execute (x) = 1
So read+write = 4+2 = 6, read+execute = 4+1 = 5, and read+write+execute = 4+2+1 = 7. This means chmod 755 gives the owner full permissions (7) and the group and others read+execute (5). chmod 644 gives the owner read+write (6) and everyone else read-only (4).
What the Permissions Mean in Practice
For files: read means you can view the file's contents, write means you can modify or delete it, and execute means you can run it as a program or script. For directories: read means you can list the directory's contents (ls), write means you can create, rename, or delete files inside it, and execute means you can enter the directory (cd) and access its contents.
Common Permission Patterns
- 644 (rw-r--r--) — Standard for web files, configuration files, and documents. Owner can edit, everyone can read.
- 755 (rwxr-xr-x) — Standard for directories and executable scripts. Owner can do everything, group and others can read and enter/run.
- 600 (rw-------) — Private files like SSH keys and credential files. Only the owner can read or write.
- 400 (r--------) — Read-only for owner only. Common for key files that should never be modified.
- 777 (rwxrwxrwx) — Full access for everyone. Almost always a security risk and should be avoided in production.
- 750 (rwxr-x---) — Owner has full access, group members can read and execute, others have no access. Common for restricted scripts.
The chmod Command
The chmod command is used in the terminal to change file permissions. You can use it with either octal notation (chmod 755 script.sh) or symbolic notation (chmod u+x script.sh to add execute permission for the owner). To apply permissions recursively to a directory and all its contents, use the -R flag: chmod -R 755 /var/www/html. Be careful with recursive chmod — applying wrong permissions to system directories can cause serious problems.
chmod on macOS
macOS is a Unix-based operating system, so chmod works the same way on macOS as on Linux. Open Terminal and use the same octal notation: chmod 644 myfile.txt. The ls -l command shows current permissions in symbolic format (e.g., -rw-r--r--). The first character is d for directories and - for regular files.
chmod for Web Servers
If you run a website on a Linux server (Apache, Nginx, or similar), getting file permissions right is both a security and a functionality requirement. A common and secure setup is: directories set to 755, regular files set to 644, and executable scripts set to 755. Avoid 777 permissions on a web server — they allow the web server process to write and modify files, which can be exploited if your application has a file upload vulnerability. For SSH key files used in deployment, use 600 or 400. For related system administration tools, see our Cron Parser or Hash Generator.