Chmod Calculator

Class Read (r) Write (w) Execute (x)
Owner
Group
Others
Next

Unix file permissions come in three triplets, read, write, execute for user, group, other, which collapse neatly into a three-digit octal number. chmod 755 script.sh is rwxr-xr-x: owner has everything, group and others have read and execute. This calculator lets you toggle each checkbox and see the octal flip live, or paste an octal number and see the rwx breakdown, with the exact chmod command ready to copy.

How chmod permissions work

  1. 1

    Toggle the 9 permission bits

    Three groups (user, group, other) × three permissions (read, write, execute) = 9 checkboxes.

  2. 2

    Each group becomes one octal digit

    Read = 4, write = 2, execute = 1. Sum the bits you want enabled.

  3. 3

    Read the resulting octal and symbolic form

    e.g. 755 → rwxr-xr-x; 644 → rw-r--r--; 600 → rw-------.

  4. 4

    Copy the chmod command

    The tool shows the chmod command for the current permissions, ready to copy. Examples: chmod 755 filename, chmod u+x filename, chmod -R 755 directory.

Permission bit values

Bit Value Meaning for files Meaning for directories
Read 4 Can view contents Can list entries
Write 2 Can modify Can create / delete / rename entries
Execute 1 Can run as a program Can traverse (cd into, access inside)

Common chmod values

Octal Symbolic Typical use
777 rwxrwxrwx World-writable, dangerous; rarely correct
755 rwxr-xr-x Scripts, binaries, directories
750 rwxr-x--- Scripts private to you and your group
700 rwx------ Scripts private to you (SSH, ~/.ssh)
644 rw-r--r-- Public documents, images, HTML
640 rw-r----- Group-readable configs
600 rw------- Private configs, SSH private keys, ~/.netrc
444 r--r--r-- Read-only published files
400 r-------- Private read-only (rarely correct; use 600)

Special permissions (rare but important)

  • setuid (4xxx): runs the file as its owner, regardless of who executes. /usr/bin/passwd uses this.
  • setgid (2xxx): on files, runs as the group. On directories, new files inherit the directory’s group.
  • sticky bit (1xxx): on directories, only the file’s owner can delete/rename. /tmp uses this.

Four-digit octals include these: chmod 4755 setuid-binary turns on setuid alongside 755.

Symbolic chmod

Many admins prefer symbolic form for incremental changes:

  • chmod u+x script, add execute for the owner only.
  • chmod go-w file, remove write for group and other.
  • chmod a+r file, give read to all (user, group, other).
  • chmod u=rw,go=r file, set exactly these bits.
  • chmod -R 755 directory, recursive.

Common mistakes

  • 777 on uploads folders: seems to “fix permissions”; actually opens the server to attackers. Use a narrower combination (e.g. 755 with correct group ownership).
  • chmod -R 644 on directories: removes execute on directories, so you can’t cd into them. Use 755 for directories, 644 for regular files.
  • 0600 vs 600: leading zero indicates octal in C and shell; most chmod implementations accept both.
  • Umask: new files inherit 666 minus the umask. Default umask 022 gives 644 files and 755 directories.

Frequently Asked Questions

You typically want the owner to be able to modify, and everyone else to be able to list and traverse. 755 = rwx for owner, r-x for group and other, exactly that combination.

Almost never. 777 lets anyone on the system modify the file. In multi-user systems it’s a security hole; in single-user systems it’s unnecessary (the owner already has rwx with 755). If a web app seems to need 777, the real fix is correct ownership (chown) or group membership.

~/.ssh directory: 700. Private keys (id_rsa, id_ed25519): 600. Public keys (.pub): 644. authorized_keys: 600. SSH refuses keys with wider permissions as a safety measure.

chown for owner, chgrp for group, separate commands. chmod only changes bits, not the user/group owning the file.

Related Tools