Chmod Calculator

Calculate Linux/Unix file permissions in octal and symbolic notation

Free chmod calculator to convert between octal (755, 644) and symbolic (rwxr-xr-x) Linux file permissions. Generate a ready-to-copy chmod command instantly. 100% client-side.

chmod filename
Read (4)
Write (2)
Execute (1)
Octal
Owner u
0
Group g
0
Others o
0
Symbolic
---------
Linux Command
chmod 000 filename
Permission Summary
Owner: No permissions
Group: No permissions
Others: No permissions
Common Presets

Chmod Permission Reference

Octal Symbolic Permissions Common Use
755rwxr-xr-xOwner: all, Group/Others: read+execExecutable scripts, web directories
644rw-r--r--Owner: read+write, Group/Others: readHTML, CSS, images, config files
777rwxrwxrwxEveryone: all permissionsTemporary/dev only (security risk)
700rwx------Owner: all, no access for othersPrivate scripts, home directories
600rw-------Owner: read+write onlySSH keys, private configs
444r--r--r--Everyone: read onlyRead-only files, public docs
750rwxr-x---Owner: all, Group: read+execGroup-accessible programs
664rw-rw-r--Owner+Group: read+write, Others: readShared project files
640rw-r-----Owner: read+write, Group: readLog files, sensitive configs
400r--------Owner: read onlySSH private keys (strict)

Click any row to load those permissions

Chmod Guide

What is chmod?

chmod (change mode) is a Unix/Linux command that sets file and directory permissions. Every file has three permission categories: Owner (the user who created it), Group (users in the file's group), and Others (everyone else). Each category can have Read, Write, and Execute permissions.

How Octal Values Work

Each permission has a numeric weight: Read = 4, Write = 2, Execute = 1. Add them together for each role:

  • 7 (4+2+1) = Read + Write + Execute (rwx)
  • 6 (4+2) = Read + Write (rw-)
  • 5 (4+1) = Read + Execute (r-x)
  • 4 (4) = Read only (r--)
  • 3 (2+1) = Write + Execute (-wx)
  • 2 (2) = Write only (-w-)
  • 1 (1) = Execute only (--x)
  • 0 = No permissions (---)

The three digits in chmod 755 represent Owner (7), Group (5), Others (5).

Symbolic Notation

Symbolic notation uses letters: r (read), w (write), x (execute), - (no permission). The 9-character string is grouped in threes: rwxr-xr-x = Owner(rwx) + Group(r-x) + Others(r-x).

You can also use symbolic mode with chmod: chmod u=rwx,g=rx,o=rx filename is equivalent to chmod 755 filename. Use + to add and - to remove permissions: chmod g+w filename adds write permission for the group.

Recursive Chmod (chmod -R)

Use chmod -R to change permissions recursively on a directory and all its contents: chmod -R 755 /var/www/html. This applies the same permission to every file and subdirectory inside.

However, files and directories usually need different permissions. A better approach is to set them separately:

  • Directories to 755: find /path -type d -exec chmod 755 {} +
  • Files to 644: find /path -type f -exec chmod 644 {} +

This ensures directories are traversable (need execute) while files remain non-executable.

Making Files Executable (chmod +x)

chmod +x filename adds execute permission for all users. This is the fastest way to make a script runnable. For finer control:

  • chmod u+x: Add execute for the owner only
  • chmod g+x: Add execute for the group only
  • chmod o-x: Remove execute for others
  • chmod a+x: Add execute for all (same as +x)

After adding execute permission, run a script with ./script.sh. If you see "Permission denied", you likely need to run chmod +x script.sh first.

Default Permissions and umask

Linux uses umask to determine default permissions for new files and directories. The default umask is typically 022, which means:

  • New files: 666 - 022 = 644 (rw-r--r--)
  • New directories: 777 - 022 = 755 (rwxr-xr-x)

Check your current umask with the umask command. A more restrictive umask like 077 creates files as 600 and directories as 700, giving access only to the owner.

Security Best Practices

  • Never use 777 in production. It gives everyone full access including write and execute.
  • SSH keys must be 600 or 400. SSH refuses to use keys with broader permissions.
  • Web files should be 644 (files) and 755 (directories). The web server user needs read access; only the owner should write.
  • Scripts need execute (x) permission. Use 755 for scripts that others may run, 700 for private scripts.
  • Principle of least privilege: Always grant the minimum permissions needed.

Chmod Calculator FAQ

What is chmod?

chmod (change mode) is a Unix/Linux command that changes file and directory permissions. It controls who can read, write, or execute a file. Permissions are set for three categories: Owner, Group, and Others.

What does chmod 755 mean?

chmod 755 sets rwxr-xr-x. The owner gets full permissions (7 = read+write+execute). Group and others get read and execute (5 = read+execute). This is the standard permission for executable scripts and web directories.

What does chmod 644 mean?

chmod 644 sets rw-r--r--. The owner can read and write (6). Group and others can only read (4). This is the default for regular files like HTML pages, images, and configuration files.

Why is chmod 777 dangerous?

chmod 777 gives everyone full read, write, and execute permissions. Any user on the system can modify or delete the file. Never use 777 in production. Use 755 for directories and 644 for files instead.

What permissions do SSH keys need?

SSH private keys must be chmod 600 (rw-------) or chmod 400 (r--------). SSH will refuse to use a key file with permissions that are too open. The .ssh directory should be chmod 700.

What is the difference between octal and symbolic chmod?

Octal uses numbers: chmod 755 file. Symbolic uses letters: chmod u=rwx,g=rx,o=rx file. Both produce the same result. Octal sets all permissions at once; symbolic can make relative changes like chmod g+w file.

What chmod should web files have?

Web files should be 644 (rw-r--r--) and web directories should be 755 (rwxr-xr-x). The web server needs read access to serve files and execute access to traverse directories. Only the owner should have write access.

How do I make a file executable?

Run chmod +x filename to add execute permission for all users, or chmod u+x filename for the owner only. For scripts, chmod 755 is the most common choice, giving the owner full control and others read+execute access.

How do I use chmod recursively?

Use chmod -R 755 /path/to/directory to change permissions recursively on a directory and all its contents. For best practice, set directories and files separately: find /path -type d -exec chmod 755 {} + for directories and find /path -type f -exec chmod 644 {} + for files.

What does chmod +x do?

chmod +x adds execute permission for all users (owner, group, others). It's the quickest way to make a shell script or binary executable. Use chmod u+x to add execute only for the owner. If you see "Permission denied" when running a script, you need chmod +x.

What is the default file permission in Linux?

New files default to 644 (rw-r--r--) and new directories to 755 (rwxr-xr-x). This is controlled by umask, typically set to 022. The umask subtracts from the maximum: 666 - 022 = 644 for files, 777 - 022 = 755 for directories.

What does chmod 400 mean?

chmod 400 sets r--------. Only the file owner can read it. No one can write or execute. This is the strictest common permission, used for SSH private keys and sensitive credentials. It's more restrictive than chmod 600, which also allows the owner to write.