Skip to content
Toolcroft

Developer Tools

chmod Calculator - File Permission Calculator

Convert between octal chmod codes and symbolic rwx permissions. Toggle read, write, and execute for owner, group, and others instantly.

EntityRead (4)Write (2)Execute (1)Octal
Owner7
Group5
Other5
rwxr-xr-x
chmod 755 <file>

Common presets

Understanding Unix file permissions

Unix/Linux file permissions are controlled with a 9-bit octal system. Each file and directory has three permission groups: Owner, Group, and Others. Each group has three bits: read (r), write (w), and execute (x).

Octal notation

OctalBinaryPermissions
0000--- (none)
1001--x (execute)
2010-w- (write)
3011-wx (write + execute)
4100r-- (read)
5101r-x (read + execute)
6110rw- (read + write)
7111rwx (all)

Common permission patterns

  • 644 - owner: rw-, group: r--, others: r-- (typical file)
  • 755 - owner: rwx, group: r-x, others: r-x (typical script/directory)
  • 600 - owner: rw-, group: ---, others: --- (private key, SSH config)
  • 777 - all users: rwx (avoid - insecure)

Special permission bits

BitOctalEffect on filesEffect on directories
Setuid (SUID) 4xxx (e.g., 4755) Process runs as file owner, not caller (e.g., /usr/bin/passwd) No standard effect (ignored on most Linux systems)
Setgid (SGID) 2xxx (e.g., 2755) Process runs with file's group New files inherit directory's group; useful for shared project directories
Sticky bit 1xxx (e.g., 1777) Historically prevented swapping; largely obsolete for files Only the owner can delete their own files (used on /tmp)

Symbolic chmod notation

Octal notation sets all nine bits at once. Symbolic notation allows incremental changes without knowing the current permissions:

  • chmod +x file: add execute permission for all (user, group, other)
  • chmod u+x file: add execute for owner only
  • chmod go-w file: remove write from group and other
  • chmod u=rwx,g=rx,o=r file: set exact permissions symbolically (equivalent to chmod 754)
  • chmod a+r file: add read for all; a means all (same as ugo)

umask: default file creation permissions

The umask is a bitmask that is subtracted from the maximum permissions when creating new files and directories. The default umask is typically 022:

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

A more restrictive umask of 027 gives 640 for files and 750 for directories, preventing "others" from reading anything by default.