Chmod Calculator

Permissions

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

Special Permissions

Quick Presets

Result

chmod 644 filename
chmod u=rw,g=r,o=r filename

What Are Unix File Permissions?

Every file and directory on a Unix or Linux system carries a set of permissions that decide who is allowed to read it, change it, or run it. Permissions are divided across three classes of user: the file’s owner (the user account that owns it), the file’s group (a set of users who share access), and others (everyone else on the system). For each class, three independent flags can be turned on or off: read (r), write (w), and execute (x). This nine-bit model is the foundation of access control on virtually every Linux server, macOS machine, and shared web host.

The chmod command (“change mode”) is how you set these permissions. It accepts permissions either in symbolic notation (such as -rwxr-xr-x, where each character shows whether a flag is set) or in numeric octal notation (such as 755), where read is worth 4, write is worth 2, and execute is worth 1. You add those values together for each user class to get a single digit, so rwx = 4 + 2 + 1 = 7, rw- = 6, and r-x = 5. A leading fourth digit can also be supplied for special permission bits.

How to Use This Chmod Calculator

Tick the read, write, and execute checkboxes for Owner, Group, and Others in the permissions grid, and the calculator instantly updates the octal value, the symbolic string, and a ready-to-run chmod command. You can also type a value directly into the Numeric (Octal) field — enter three or four octal digits and the checkboxes and symbolic notation update to match. The Quick Presets row offers one-click common values such as 644, 755, 600, and 777, and the Special Permissions checkboxes let you add SUID, SGID, or the sticky bit.

It also works the other way round: type into the Symbolic field to convert to numbers. Paste a permission string straight from ls -l — -rwxr-xr-x, drwxr-sr-x or -rw-r--r--. with its SELinux dot — and you get 755, 2755 or 644. You can also type the clauses chmod itself understands: an absolute mode like u=rwx,g=rx,o= (750) or a change like g+w,o-r, which is applied to the permissions that were shown when you started typing. If something is not valid, a short message under the field says which character or clause is wrong.

Enter the file or directory name and tick Recursive (-R) to get a complete command, quoted correctly if the name contains spaces. You get it in both forms — chmod 750 file and chmod u=rwx,g=rx,o= file — each with its own Copy button, next to Copy buttons for the bare octal number and the symbolic string. The address bar keeps the current value (for example ?mode=2775), so you can bookmark it or send it to a colleague. The Explanation panel describes in plain English what each class can do, so you can confirm a value before applying it.

Real-World Use Cases

  • Setting up a web directory — Apply 644 to HTML, CSS, and image files and 755 to directories so the web server can read and traverse them without exposing write access.
  • Securing config files — Use 600 on files holding database credentials or API keys so only the owning account can read them.
  • Making a script executable — Add the execute bit to turn a shell script into a runnable program, typically landing on 755 or 700.
  • Fixing “Permission denied” errors — Translate the permissions your application needs into the correct octal value and confirm it before running chmod.
  • Learning and teaching — Toggle individual bits to see how symbolic and octal notation relate, a clear way to understand the permission model.

Tips for Setting File Permissions

  • Avoid 777 on web servers — granting write access to everyone is a common source of security breaches and is rarely necessary.
  • Directories almost always need the execute bit set, because x on a directory means “may enter and traverse it,” not “may run a program.”
  • Prefer the most restrictive permission that still works; start tight and only loosen if something genuinely needs more access.
  • Use chmod -R with care — recursively applying a file value like 644 to a tree will strip the execute bit directories need.
  • Remember that permissions are only half the picture; ownership (set with chown) determines which account counts as the owner and group.

Features

  • Interactive permission grid — Toggle read, write, and execute for owner, group, and others.
  • Converts in every direction — Type an octal value, tick checkboxes, or paste a symbolic string like rwxr-xr-x or drwxrwsr-x.
  • Understands chmod clauses — Absolute (u=rwx,g=rx,o=, a=r) and relative (g+w, o-rwx, u+s, +t) modes.
  • Clear error messages — Invalid digits or clauses are explained instead of silently ignored.
  • Ready-to-copy commands — Numeric and symbolic chmod commands with your file name, optional -R and safe quoting.
  • Shareable links — The current mode is stored in the URL.
  • Special permission bits — Set SUID, SGID, and the sticky bit, reflected correctly in both notations.
  • Quick presets — One click applies common values like 644, 755, 600, and more.
  • 100% client-side — Your data never leaves your browser.

Frequently Asked Questions

What does chmod 755 mean?

755 gives the owner read, write, and execute (7 = 4 + 2 + 1), and gives the group and others read and execute but not write (5 = 4 + 1). It is the standard permission for directories and executable scripts, allowing everyone to read and run while only the owner can modify.

What is the difference between symbolic and numeric notation?

Symbolic notation spells out each flag as a character, like -rw-r--r--, where the dashes mark unset permissions. Numeric (octal) notation collapses each user class into a single digit by summing read (4), write (2), and execute (1), giving a compact value such as 644. Both describe the exact same permissions, and this calculator shows them side by side.

What are SUID, SGID, and the sticky bit?

These are special permission bits represented by the optional leading digit. SUID (4) makes an executable run with the file owner’s privileges, SGID (2) makes it run with the group’s privileges (and makes new files in a directory inherit its group), and the sticky bit (1) on a directory means only a file’s owner can delete it, which is how shared folders like /tmp stay safe.

Why does the execute bit matter on directories?

On a directory, the execute bit does not run anything; instead it controls whether a user can enter the directory and access files inside it by name. A directory with read but not execute lets you list filenames yet not open them, so directories you want people to use normally almost always need the execute bit set.

What does the leading zero in 0644 represent?

The leading digit is the special-permissions field for SUID, SGID, and the sticky bit. A value of 0 means none of them are set, so 0644 is identical in effect to 644. A value like 4755 would turn on SUID in addition to the rwxr-xr-x permissions.

How do I convert rwxr-xr-x to numbers?

Split the nine characters into three groups of three — rwx, r-x, r-x — and add 4 for r, 2 for w and 1 for x in each group: 7, 5, 5, so rwxr-xr-x is 755. A leading d or - from ls -l is the file type and does not count. An s in the owner or group position adds 4000 or 2000, a t at the end adds 1000. Or paste the string into the Symbolic field above.

How do I set 755 on directories and 644 on files at once?

chmod -R applies one mode to everything, which either makes all files executable (755) or locks you out of directories (644). Use find to treat them separately: find /path -type d -exec chmod 755 {} + for directories and find /path -type f -exec chmod 644 {} + for files. Alternatively, chmod -R u=rwX,go=rX /path gives execute only to directories and to files that are already executable — the capital X means “execute if it is a directory or already executable for someone”.

Is it safe to use chmod 777?

Generally no. 777 grants read, write, and execute to every user on the system, which means any account or compromised process can modify or replace the file. On shared hosting or public servers this is a serious risk; in almost all cases a more restrictive value such as 644, 755, or 600 achieves what you need without exposing the file to everyone.