chmod Calculator

Calculate Unix file permissions visually. Click checkboxes or type the octal/symbolic value — all fields update instantly.

644
rw-r--r--

Owner (u)

Group (g)

Others (o)

chmod 644 filename
Owner can read and write. Group and Others can read only.

How to Use the chmod Calculator

  1. Check the boxes to set read, write, and execute permissions for the Owner, Group, and Others.
  2. 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.
  3. Use a preset — click any preset chip above for the most common permission patterns.
  4. 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.

Frequently Asked Questions

chmod stands for "change mode". It is a Unix command used to change the access permissions of files and directories. The command controls who can read, write, or execute a file — distinguishing between the file owner, the owner's group, and all other users on the system.
chmod 755 means the owner has read, write, and execute permissions (7 = 4+2+1), while the group and others each have read and execute permissions (5 = 4+1). In symbolic notation, this is rwxr-xr-x. This is the most common permission for executable files and directories on web servers.
chmod 644 means the owner has read and write permissions (6 = 4+2), while the group and others have read-only permissions (4). In symbolic notation, this is rw-r--r--. This is the standard permission for regular files — documents, configuration files, and web page assets.
chmod 777 gives read, write, and execute permissions to everyone. This is rarely safe in production and should almost never be used on a web server. Any user on the system can modify or execute a 777 file. Use the minimum permissions necessary: 644 for files, 755 for directories.
Each permission digit is the sum of read (4), write (2), and execute (1) for each class. For example, read+write = 4+2 = 6, and read+execute = 4+1 = 5. So chmod 644 means owner has read+write (6), group has read (4), others have read (4). Use this calculator to set permissions visually and instantly see the octal code, symbolic notation, and the ready-to-use command.