Chmod Calculator

Build Unix/Linux file permissions visually. Convert between numeric (octal) and symbolic notation with instant command generation for your terminal.

๐Ÿ” Permission Builder
๐Ÿ”ข Quick Octal Input
Numeric
755
Symbolic
rwxr-xr-x
๐Ÿ’ป Linux Command
chmod 755 filename
๐Ÿ“– What this means:

Owner can read, write and execute. Group can read and execute. Others can read and execute.

Common Presets:

๐Ÿ›ก๏ธ Security First

Avoid using 777 permissions on web servers. It allows anyone to read, write, and execute your files, creating a massive security hole.

โšก Pro Tip

Use chmod -R to apply permissions recursively to all files and subdirectories within a folder.

What is Chmod?

Chmod (short for "change mode") is a Unix/Linux command used to modify file and directory permissions. The chmod calculator above helps you visualize and generate the correct permission codes without memorizing octal values.

In Unix-like operating systems, every file and directory has three types of permissions for three categories of users:

Read (r) 4
Write (w) 2
Execute (x) 1

Understanding Octal Notation

The chmod numeric format uses three digits (or four with special permissions). Each digit represents permissions for Owner, Group, and Others:

  • 7 (rwx): Read + Write + Execute - Full control
  • 6 (rw-): Read + Write - Can modify but not execute
  • 5 (r-x): Read + Execute - Can view and run
  • 4 (r--): Read only - Can only view
  • 3 (-wx): Write + Execute - Rare use case
  • 2 (-w-): Write only - Very rare
  • 1 (--x): Execute only - Cannot view contents
  • 0 (---): No permissions

Common Chmod Examples

Here are the most frequently used chmod permission combinations for web development and system administration:

Web Server Files:

  • chmod 644 index.html - Standard web file (owner can edit, others can read)
  • chmod 755 public/ - Web directory (owner full access, others can browse)
  • chmod 600 config.php - Config file with passwords (owner only)

Scripts & Executables:

  • chmod 755 script.sh - Shell script everyone can run
  • chmod 700 backup.sh - Private admin script
  • chmod 750 deploy.sh - Team script (group can execute)

Directories:

  • chmod 755 /var/www/html/ - Public web directory
  • chmod 775 /uploads/ - Shared upload folder
  • chmod 700 ~/.ssh/ - SSH private directory

Symbolic vs Numeric Notation

Chmod supports two formats: numeric (octal) and symbolic. Both achieve the same result:

Numeric Format:

chmod 755 file.txt

Symbolic Format:

chmod u=rwx,g=rx,o=rx file.txt

Symbolic shortcuts:

  • chmod +x script.sh - Add execute for all
  • chmod -w file.txt - Remove write for all
  • chmod u+x file - Add execute for user only
  • chmod go-w file - Remove write for group and others

Frequently Asked Questions About Chmod

What does chmod 777 mean and why is it dangerous?

chmod 777 gives read, write, and execute permissions to everyone (owner, group, and others). This is extremely dangerous on web servers because any user on the system can modify or delete your files. Hackers often exploit 777 permissions to inject malicious code. Never use 777 on production servers.

What's the difference between chmod 755 and 644?

755 includes execute permission (rwxr-xr-x) - use for directories and scripts. 644 has no execute permission (rw-r--r--) - use for regular files like HTML, CSS, and text files. If you chmod 644 a script, it won't run.

How do I apply chmod recursively to all files in a directory?

Use the -R flag: chmod -R 755 /path/to/directory. This applies permissions to the directory and all files/subdirectories within it. Be careful - this affects everything inside!

What permissions should WordPress files have?

WordPress recommends: Directories: 755, Files: 644, and wp-config.php: 600 or 440. Never use 777 on a WordPress installation. The wp-content/uploads directory may need 755 or 775 depending on your server configuration.

Can I use chmod on Windows?

No, native Windows doesn't support chmod. Windows uses Access Control Lists (ACLs) instead. However, if you're using WSL (Windows Subsystem for Linux), Git Bash, or Cygwin, chmod will work within those Unix-like environments.

How do I check current file permissions?

Use ls -l filename to see symbolic notation (rwxr-xr-x), or stat filename to see both symbolic and octal notation. In our chmod calculator, you can enter any octal value to see its symbolic equivalent instantly.

Chmod Security Best Practices

  • Never use 777 on web servers - it's a major security vulnerability
  • Protect sensitive files with 600 (owner read/write only)
  • SSH keys should be 600 or 400 (private keys) and 644 (public keys)
  • Database credentials in config files should be 600 or 640
  • Use 755 for directories to allow navigation without write access
  • Web root files should typically be 644 (read-only for others)
  • CGI/scripts need execute permission: 755 or 750
  • Log files can be 644 or 640 depending on sensitivity

Special Permissions (Advanced)

Beyond basic read/write/execute, Unix has three special permission bits:

SetUID (4):

When set on an executable, it runs with the owner's privileges instead of the user who launched it. Example: chmod 4755 program. Common on system tools like /usr/bin/passwd.

SetGID (2):

On executables, runs with group's privileges. On directories, new files inherit the directory's group. Example: chmod 2755 shared-folder.

Sticky Bit (1):

On directories, only the file owner can delete their files (even if others have write permission). Common on /tmp. Example: chmod 1777 /tmp.