Free Chmod Calculator

Interactive Linux/Unix file permission calculator.

No data leaves your device
Read (4)
Write (2)
Execute (1)
Owner
Group
Others
Numeric
Symbolic ---------
chmod 000 filename

Common Permissions

How to Use

  1. Toggle the checkboxes to set read, write, and execute permissions for Owner, Group, and Others.
  2. Or type a 3-digit numeric value (e.g., 755) directly.
  3. The symbolic notation and chmod command update in real time.
  4. Click Copy Command to copy the full chmod command.

Permission Reference

Number Permission Symbol
0No permission---
1Execute only--x
2Write only-w-
3Write + Execute-wx
4Read onlyr--
5Read + Executer-x
6Read + Writerw-
7Read + Write + Executerwx

Frequently Asked Questions

What does chmod 755 mean?

755 means the owner can read, write, and execute (7), while the group and others can read and execute but not write (5). This is the most common permission for directories and scripts.

What's the difference between 644 and 755?

644 (rw-r--r--) allows the owner to read/write and everyone else to read only · typical for files. 755 (rwxr-xr-x) adds execute permission · typical for directories and scripts.

Does this work for directories too?

Yes. The numeric permissions work the same way. For directories, "execute" means the ability to enter the directory and access its contents.

The Unix permission model in 9 bits

Every file and directory on a Unix-like system carries a "mode", a small integer that records who can do what. The model is essentially unchanged since Sixth Edition Unix (May 1975), with the earliest chmod manual entries appearing in Version 1 Unix (November 1971). It encodes nine permission bits arranged as three triples of read / write / execute, one triple each for the file's owner, its group, and everyone else:

Owner    Group    Others
r w x    r w x    r w x
4 2 1    4 2 1    4 2 1

Each three-bit group is exactly one octal digit because three bits encode 2³ = 8 distinct values (0–7). The weights 4, 2, 1 are 2², 2¹, 2⁰. Adding any combination of read (4) + write (2) + execute (1) produces the eight possible per-class digits without collision, that's the entire octal-to-symbolic mapping. chmod 755 therefore means rwx (4+2+1=7) for the owner, r-x (4+1=5) for the group, and r-x for everyone else.

The 10-character string you see in ls -l is the same data plus one extra column up front for the file type: - for a regular file, d for a directory, l for a symlink, c for a character device, b for a block device, p for a named pipe, s for a socket. The remaining nine characters are the permission triples.

Symbolic notation: chmod u+x file

Octal modes overwrite all nine bits at once. Symbolic modes are non-destructive, they only flip the bits you name. The grammar is who + op + perm:

Useful examples:

Numeric modes are explicit and idempotent (chmod 755 always means the same nine bits). Symbolic modes are surgical (chmod g+w only flips one bit). Production scripts tend to favour numeric for clarity in audit logs; operators typing at the shell tend to favour symbolic for incremental tweaks.

Common modes and what they're for

ModeSymbolicTypical use
755rwxr-xr-xPublic executables and standard directories, /usr/bin/*, web docroots, Git working trees
644rw-r--r--Standard regular files, config, source code, documents
700rwx------Private directory, ~/.ssh, personal docs nobody else should see
600rw-------Private file, ~/.ssh/id_rsa, ~/.gnupg/*, password files
444r--r--r--Read-only for everyone, fixed reference data, Cargo registry indexes
750rwxr-x---Owner full, group read/traverse, others nothing, group-shared service directory
777rwxrwxrwxAlmost always wrong. See below.

Why chmod 777 is almost always wrong

Setting a file to 777 makes it world-readable, world-writable and world-executable. Any user on the machine (including unprivileged service accounts and any process that ever gets compromised) can read the file's contents, modify it, and run it. The standard tutorial advice "just chmod 777 until it works" is a security antipattern that has been responsible for countless real breaches: world-writable configuration files that get tampered with, world-writable web directories that become defacement vectors, world-writable log files that allow log forgery, world-executable directories that allow arbitrary code execution.

If a permissions error is blocking you, the right fix is almost always to change the file's owner (with chown) or its group (with chgrp) so the user that needs access actually owns or co-owns the file, not to remove access controls for everyone.

Special bits: setuid, setgid, sticky

A fourth octal digit prepended to the mode unlocks three special bits, all relics of the original Unix design:

The ls -l display swaps the execute character to s, S, t or T when these bits are set (capital letters mean the bit is set but the underlying execute bit is not).

umask: the inverse of chmod

chmod sets permissions on existing files. umask determines the default permissions on files you create, by acting as a subtractive mask. The arithmetic: a new regular file would be 666 (rw-rw-rw-), a new directory 777, minus whatever's set in the umask. Common values:

Typing umask with no arguments shows the current value. Setting it in your shell init (~/.bashrc, ~/.zshrc) or in /etc/login.defs applies to the whole session.

Files vs directories, different meanings of x

The same r/w/x bits mean subtly different things on directories than on files:

Recursive chmod and the find pattern

chmod -R 755 /var/www applies the same mode to every file and directory in the tree, which is almost always wrong because files and directories want different modes (e.g., 644 for files, 755 for directories). The correct idiom uses find:

find /var/www -type f -exec chmod 644 {} +
find /var/www -type d -exec chmod 755 {} +

Or, equivalently, using GNU chmod's capital X: chmod -R u=rwX,go=rX /var/www grants execute only on directories and on files that already had execute somewhere, exactly the result you usually want.

Symlinks, ACLs, and how Linux extends the model

Two refinements worth knowing:

More questions

Why does my SSH key get rejected with "permissions are too open"?

Because the OpenSSH client refuses to use a private key that's group- or world-readable, on the assumption that anything other people can read shouldn't be a credential. The fix is chmod 600 ~/.ssh/id_rsa (and chmod 700 ~/.ssh on the directory itself). Same logic for ~/.gnupg/ and most other credential stores.

What's the difference between chmod and chown?

chmod changes the mode bits, what owner/group/others can do. chown changes who the owner is. Frequently you need both: a file that "the wrong user can't read" usually doesn't need its permissions opened up; it needs to be owned by the user that needs access. Try chown myuser:mygroup file first.

Should I use 666 for log files?

Almost never. World-writable log files allow any process (including a compromised service running as a low-privilege user) to forge log entries or wipe the log. The standard pattern is to make the log directory writable by a specific log group (adm on Debian, wheel on BSD, etc.) and add the relevant services to that group, or to use logrotate + a logging daemon (rsyslog, systemd-journald) that handles file ownership for you.

Does this calculator account for the special bits?

No, it covers the base nine permission bits (the standard 3-digit mode). For setuid (4xxx), setgid (2xxx) or sticky (1xxx) you'd prepend the leading digit manually. The vast majority of day-to-day chmod work uses 3-digit modes and never touches the special bits.

Does anything get sent to a server?

No. The toggle ↔ octal ↔ symbolic conversion is pure arithmetic, computed in your browser. The page works offline once it's loaded.

Related Tools

.htaccess Generator Cron Expression Generator File Hash