Skip to main content

Free chmod Permissions Calculator

Toggle Unix file permissions for owner, group, and other to get the octal value (755), symbolic notation (rwxr-xr-x), and the exact chmod command.

Works offline once loaded
ReadWriteExecuteValue
Owner7
Group5
Other5
Special bits
Octal (editable)
rwxr-xr-x
Symbolic
Command
$ chmod 755 filename

Common presets

Common uses

  • Correct File Permissions for Web ServersSet the right permissions for web files and folders on Apache/Nginx servers.
  • Set SSH Key PermissionsSSH refuses keys with loose permissions. Get the exact chmod for your key files.
  • Make Shell Scripts ExecutableGet the chmod command to make a script runnable while keeping it secure.
  • Learn Linux File PermissionsUnderstand how octal and symbolic Unix permissions map to read/write/execute.
  • File Permissions in Docker ImagesSet correct permissions for files copied into Docker containers.

How It Works

This tool is a hand-written, fully client-side Unix permissions calculator β€” no libraries, no server. It models each permission as a boolean in a React state matrix and converts between octal, symbolic, and ls -l formats using direct bitwise arithmetic.

  1. 1
    Checkbox matrix sets state
    Each of the nine read/write/execute checkboxes (owner, group, other) toggles a boolean in a React state object. Special bits β€” setuid, setgid, and sticky β€” are tracked separately in a parallel state object.
  2. 2
    Bitwise arithmetic computes octal
    The octalFor() function sums the active permission values for each group using the fixed weights r=4, w=2, x=1. The three group digits are concatenated, and if any special bit is set, a fourth leading digit (setuid=4, setgid=2, sticky=1) is prepended.
  3. 3
    Bidirectional parsing syncs all inputs
    Typing a 3- or 4-digit octal number triggers parseOctal(), which uses bitwise AND to decompose each digit back into permission booleans and update the checkbox matrix. Pasting an ls -l line triggers parseLsPerms(), which uses a regex to extract the 9-character permission string and decodes special characters like s, S, t, and T for setuid/setgid/sticky.
  4. 4
    chmod command is assembled and copied
    The final chmod command is built by string interpolation β€” octal mode or symbolic mode (u=rwx,g=rx,o=rx form) β€” with optional -R flag and target filename. Clicking Copy writes the command to the clipboard via navigator.clipboard.writeText(), which runs locally with no network call.

Related Tools

Frequently Asked Questions