How to use this chmod calculator
Start with the grid. There are three rows — Owner, Group and Others — and three columns: Read, Write and Execute. Tick the boxes that describe the access you want, and every result on the right updates at once: the three-digit octal value, the four-digit octal value (which includes the special bits), the symbolic string, and a complete chmod command you can copy. There is no calculate button, because there does not need to be one — the maths is instant, and watching the number change as you tick a box is the fastest way to learn what each digit means.
Below the grid you will find three special bits: setuid, setgid and the sticky bit. They are off by default, and for most files they should stay off. When you switch one on, the four-digit octal value gains its leading digit and the symbolic string changes its execute letters to s or t, exactly as a real ls -l listing would show. The command box underneath takes a filename — type any name, such as index.html or uploads — and a Recursive toggle that adds the -R flag for folder work.
The calculator also runs backwards, which is how most people actually meet chmod: they inherit a number or a string and need to know what it allows. Type an octal value such as 755 or 4755 into the octal field, or a symbolic string such as rwxr-xr-x into the symbolic field, and the grid re-ticks itself to match. That reverse mode makes this page a chmod permissions calculator in both directions — an octal to symbolic permissions converter and a symbolic to octal converter in one place.
One promise, stated plainly: this tool generates commands, it does not run them. Nothing here connects to your server, opens your files, or executes anything. The command is text for you to read, check and paste into your own terminal when you are satisfied it says what you mean.
What is chmod?
Every file and folder on a Linux, Unix or macOS system carries a set of permission bits stored with it in the filesystem. Those bits answer three questions about three audiences. The audiences are the file owner (also called the user), the group the file belongs to, and everyone else, usually called others or public. The questions are whether each audience may read the file, write to it, or execute it. Nine basic bits hold the nine answers, and the chmod command — short for change mode — is how you set them.
The GNU coreutils manual describes chmod as the tool that changes the file mode bits of each named file according to the mode you give it, and that mode can be written two ways. You can give an octal number, which sets all the bits at once, or a symbolic specification, which adds and removes individual permissions with letters and plus and minus signs. The man page for chmod(1) documents both forms, and the chmod(2) system call page documents the same mode bits at the kernel level, where the values are defined as octal constants. This calculator concentrates on the numeric form, because that is the form people most often need to check before they run anything.
Octal permissions explained: 4, 2 and 1
The octal system looks like a code, but it is only addition. Read is worth 4, write is worth 2 and execute is worth 1. For each audience you add up the permissions they should have, and the sum is one digit: read and write make 6, read and execute make 5, all three make 7, read alone is 4, and nothing is 0. Three audiences means three digits, always in the order owner, group, others. That is the whole of the famous linux file permissions chart in one paragraph — every chmod value from 000 to 777 is just three small sums standing side by side.
The reason the values are 4, 2 and 1, rather than 1, 2 and 3, is that each permission is a single binary bit. Read is the bit worth 100 in binary, write is 010 and execute is 001, so every combination of the three produces a unique sum between 0 and 7 — one octal digit. There are no collisions and no ambiguity: given the digit 6, there is exactly one way to make it, 4+2, read and write. This is also why chmod numbers never contain an 8 or a 9, a fact that catches out many beginners who type a decimal-looking value and meet an error.
Work one example slowly and the system never feels mysterious again. Take chmod 755 meaning, the value searched for more than any other. The first 7 is the owner: 4+2+1, read, write and execute. The second digit, 5, is the group: 4+1, read and execute, no write. The third digit, also 5, is others: the same read and execute. So 755 says the owner controls the file completely while everyone else can look at it and run it but cannot change it — precisely the balance a published program or folder needs.
The symbolic form is the same information written as letters. Each audience gets three characters: r for read, w for write, x for execute, and a dash where a permission is missing. The 755 above becomes rwxr-xr-x. When you run ls -l, the string appears at the start of each line, preceded by one extra character: a dash for a plain file or d for a directory. Learning to read that string at sight, and to convert octal to symbolic permissions without hesitation, is most of what chmod fluency means in daily work.
Common chmod values and when to use each
Out of 512 possible combinations, working administrators use perhaps a dozen values over and over. The table below is the practical linux file permissions chart: the values you will meet on real systems, what they allow, and where each one belongs. The pattern to notice is how rarely write permission is given away beyond the owner — almost every safe value keeps write in the first digit only.
| Octal | Symbolic | Who can do what | When to use it |
|---|---|---|---|
| 400 | r-------- | Owner reads; nobody writes or executes | Read-only reference files and backups you never want edited in place |
| 600 | rw------- | Owner reads and writes; nobody else has any access | Private keys, configuration files with secrets, personal data files |
| 644 | rw-r--r-- | Owner reads and writes; group and others read only | The standard for ordinary files: web pages, images, documents, source code |
| 664 | rw-rw-r-- | Owner and group read and write; others read only | Shared project files where a team edits together on one server |
| 700 | rwx------ | Owner does everything; nobody else has any access | Private folders and personal scripts that no other account should even see |
| 711 | rwx--x--x | Owner full access; group and others can execute or pass through only | Folders others must cross to reach a known file, without listing the contents |
| 755 | rwxr-xr-x | Owner full access; group and others read and execute | The standard for folders and programs: web directories, scripts, executables |
| 775 | rwxrwxr-x | Owner and group full access; others read and execute | Shared upload or deployment folders maintained by a team group |
| 777 | rwxrwxrwx | Everyone can read, write and execute | Avoid. Brief troubleshooting only, on a machine you control — see the warning below |
Special bits: setuid, setgid and sticky
Beyond the nine basic bits sit three special bits, written as a fourth octal digit in front of the usual three. That digit is also a sum: setuid is worth 4, setgid 2 and the sticky bit 1. Most files should have a special digit of 0 — no special bits at all — and the three-digit values in the table above quietly assume exactly that. Reach for the fourth digit only when you know which problem it solves.
| Bit | Value | Symbolic sign | Effect on a file | Effect on a directory |
|---|---|---|---|---|
| setuid | 4 | s in the owner execute position | The program runs with the file owner privileges, whoever starts it | Ignored on most modern systems |
| setgid | 2 | s in the group execute position | The program runs with the file group privileges | New files created inside inherit the directory group — the standard trick for shared team folders |
| sticky | 1 | t in the others execute position | Historically kept a program in memory; largely ignored for files today | Only a file owner (or root) can delete or rename their own files inside — how /tmp is shared safely |
The 777 warning, and safer habits
777 is a security risk, and this page will not pretend otherwise. It grants read, write and execute to every account on the machine. On a shared host, that includes other customers accounts and any process that has been compromised. A writable, executable file is an open door: an attacker who can write to a script the server runs has, in effect, the server. The Wikipedia overview of file-system permissions and every distribution guide make the same point — permissions exist to enforce least privilege, and 777 is the abandonment of that principle.
777 usually appears because something failed and opening everything made the error stop. The honest fix is slower but permanent: find out which user the web server runs as, give that user exactly the access it needs — often group membership plus 775 on one upload folder — and leave the rest of the site at 755 and 644. If you do use 777 to test whether permissions are the cause of a problem, note the original values first, and put them back the moment the test ends. A temporary diagnostic is understandable; a forgotten 777 left on a live site is how small sites get defaced.
Three habits prevent most permission trouble. First, default to least privilege: start at 644 or 755 and add access only when a real user needs it. Second, treat recursive changes with suspicion — chmod -R applies one value to files and folders alike, and the two need different values, so run separate passes, one for directories and one for files, rather than one blunt sweep. Third, check before and after: ls -l shows the symbolic string, and stat -c %a shows the octal value on Linux, so you can confirm the change you intended is the change that happened. This chmod command generator helps with the planning half of that discipline; the checking half happens in your terminal.
Reading the generated chmod command
The command this page builds is deliberately plain: the word chmod, an optional -R, the octal value, and the filename you supplied. That is the form the GNU coreutils manual documents and the form you will see in distribution guides from Ubuntu and Red Hat alike. Plain matters: a command you can read at a glance is a command you can sanity-check before pressing Enter, and sanity-checking is the whole game with a tool that can lock you out of your own site in one line.
Chmod for websites, uploads and scripts
Most readers arrive at chmod through a website that has just broken, so here is the working set in one place. Folders: 755. Ordinary files — HTML, CSS, images, PHP pages that are not executed as separate programs: 644. Command-line scripts and CGI programs that the server executes directly: 755, because they need the execute bit. Configuration files with passwords or keys: 600, or 640 where the server account genuinely needs group read. Upload folders the server must write to: prefer group write, 775 with the folder group set to the server group, over world write.
The execute bit on directories explains the most common beginner confusion: a folder at 644 breaks a site even though every file inside is correct, because the server cannot pass through the folder to reach the files. Read on a directory lists names; execute opens them. That asymmetry — read to see, execute to touch — is documented in the chmod(2) manual page definitions of the mode bits and is worth memorising, because it turns a baffling 403 error into a ten-second fix.
Honest limitations: what this tool does not do
This page is a calculator and a command writer, nothing more. It does not run chmod, connect to your server, or inspect your files. There is no terminal here and no way for the page to reach your hosting account; the command only exists as text until you paste it somewhere yourself. It makes no AI claims either — the conversion is fixed arithmetic (add 4, 2 and 1 per class) done by plain JavaScript in your browser, and the same boxes ticked will always produce the same number.
It also works in the mainstream Unix permission model only. Windows file permissions and NTFS access control lists are a different system, and this calculator does not convert to them. Extended Linux access control lists, managed with getfacl and setfacl, can grant named users extra rights that the nine bits do not show — a file can look like 644 in ls -l (with a plus sign after the string hinting at the ACL) while an ACL quietly grants more. Network filesystems and mounted drives can also mask or ignore mode changes. Within the standard model, though, the arithmetic here is exact, and it matches the values the kernel itself defines.
Nothing you plan here is uploaded or logged. The filenames you type exist only in the page on your device, which is the right arrangement when the files in question are the private parts of a server. Close the tab and the page forgets everything — by design.
Sources & References
- Linux man-pages — chmod(1) — the command manual: octal and symbolic modes, the -R option, and how the mode is applied to each file.
- Linux man-pages — chmod(2) — the system call and the kernel mode-bit constants (S_IRUSR, S_IWUSR and the rest) behind the 4, 2 and 1 values.
- GNU Coreutils manual — chmod invocation — the reference for symbolic modes (u, g, o, a, +, -, =) and numeric modes as implemented by GNU chmod.
- Wikipedia — File-system permissions — background on the Unix permission model, notation, special bits and how permissions differ across systems.
- Ubuntu Server documentation — User management — users, groups and permissions administration in the Ubuntu Server guide.
- Debian Wiki — Permissions — a practical walkthrough of Unix permissions, octal notation and special bits. (Substitution note: used in place of an older Red Hat page that no longer resolves; the current Red Hat user-management documentation below is also included.)
- Red Hat Enterprise Linux 8 documentation — Managing users and groups — enterprise guidance on users, groups and file access in RHEL.