Developer & Tech

Chmod Calculator

What this does

Convert Unix file permissions between symbolic (rw-r--r--) and octal (644) notation with a per-class numeric breakdown.

Enter your details

Runs in your browser

Calculator inputs

Nine-character symbolic triads or three octal digits.

Using the chmod calculator

  1. 01

    Choose the direction

    Symbolic→octal for scripting; octal→symbolic when reading ls -l output.

  2. 02

    Enter the mode

    Either notation is validated strictly; malformed input explains what went wrong.

  3. 03

    Apply with chmod

    Run chmod 644 file (or the symbolic equivalent shown) on your target.

Reading ls -l quickly

The first ten characters of ls -l output encode file type plus nine permission flags in three triads. With practice, spotting 755-versus-644 mistakes; world-writable files, missing execute bits on scripts; takes seconds.

Common modes worth memorizing

  • 600; private key files: owner read/write only
  • 644; ordinary files: owner writes, world reads
  • 700; private directories: owner-only traversal
  • 755; executables and public dirs: everyone runs, owner writes

The math behind this calculator

digit = read(4) + write(2) + execute(1), summed per owner/group/other triad

Each permission class; owner, group, others; maps read to 4, write to 2 and execute to 1; the digit is their sum. Symbolic strings are parsed character-by-character into these sums, and octal digits expand back into r/w/x flags.

Assumptions & limitations

  • Exactly nine symbolic characters or exactly three octal digits.
  • Special bits (setuid, setgid, sticky) are not modeled.
  • Directories interpret x as traversal permission.

Worked example

The everyday web-server mode rw-r--r-- converts to octal 644: the owner reads and writes while everyone else merely reads.

Frequently asked questions

Why is my script “Permission denied”?
It lacks the execute bit. Add x for the relevant classes; chmod +x script.sh, or octal 755/700 depending on audience.
What does chmod 777 mean and should I use it?
Everyone can read, write and execute. Almost never appropriate outside throwaway containers; it invites tampering.
How do setuid/sticky bits fit in?
They form a fourth leading octal digit (e.g. 1755 for sticky). This calculator models standard three-digit modes only.

Related calculators