Logo

MonoCalc

/

Chmod Calculator

Programming

SPECIAL

4

2

1

0 + 0 + 0 = 0

(folded into x)

OWNER (u)

4

2

1

4 + 2 + 0 = 6

rw-

GROUP (g)

4

2

1

4 + 0 + 0 = 4

r--

OTHERS (o)

4

2

1

4 + 0 + 0 = 4

r--

Browsers can't read Unix permission bits from a real file, so there is no file picker: type or paste the mode instead. Type: File.

ls -l string

-rw-r--r--

Octal

644

Octal (4 digits)

0644

Symbolic

u=rw,go=r

Decimal (for JSON)

420

Binary

000 110 100 100

How it looks in ls -l output

-rw-r--r--  1 user  group  1024 Jan  1 10:00 file.txt

Who can do what (file)

Owner

can read the contents

can modify the contents

cannot run it as a program

Group

can read the contents

cannot modify the contents

cannot run it as a program

Others

can read the contents

cannot modify the contents

cannot run it as a program

Unix checks the classes in order: if you are the owner, only the Owner row applies, even when Group or Others grant more. Root bypasses read/write checks.

Deleting or renaming a file depends on its directory's w+x, not on the file's own w.

Set this mode

chmod 644 file.txt
chmod u=rw,go=r file.txt

Change only what differs

Octal or ls string. The command changes only the bits that differ from the target above.

Check the current mode

stat -c '%a %A %n' file.txt       # Linux (GNU)
stat -f '%OLp %Sp %N' file.txt    # macOS / BSD
ls -ld file.txt

About This Tool

Chmod Calculator – Understand and Build Unix File Permissions

Every file and directory on Linux, macOS and other Unix-like systems carries a small set of permission bits that decide who may read, change or run it. The chmod command sets those bits, but its notations (octal numbers such as 755, strings such as -rwxr-xr-x and symbolic expressions such as u+x,go-w) are easy to mix up. This chmod calculator shows one mode in every notation at once, explains what it allows in plain English, and generates the commands and code you need.

The 12 permission bits

A mode has nine basic bits in three classes: the owner (u), the file's group (g) and others (o). Each class gets read (r, weight 4), write (w, weight 2) and execute (x, weight 1). Adding the weights gives one octal digit per class, so rwx is 4 + 2 + 1 = 7 and r-x is 4 + 0 + 1 = 5. Three more special bits (setuid 4, setgid 2 and sticky 1) form an optional leading digit, which is why you see four-digit modes such as 2775 or 1777.

Reading ls -l output

The first column of ls -l is ten characters: a file type (- for a regular file, d for a directory, l for a symlink) followed by three groups of rwx. Special bits fold into the execute column: a lowercase s or t means the special bit and execute are both set, while a capital S or T means the special bit is set without execute. A trailing + signals an ACL, . an SELinux context and @ macOS extended attributes.

Numeric vs symbolic modes

A numeric mode sets every bit at once: chmod 644 notes.txt. A symbolic mode changes only what you name: chmod g+w report.csv adds group write and leaves everything else alone. Symbolic clauses combine a class (u g o a), an operator (+ - =) and letters (r w x X s t), separated by commas. The simulator tab evaluates these expressions step by step, including the subtle cases:

ExpressionWhat happens
+wNo class given, so the umask filters it: on 444 with umask 022 the result is 644
a+XAdds execute only to directories and to files that already have an execute bit
g=uCopies the owner's permissions to the group: 754 becomes 774
o+sNo effect: s only exists for the owner and group

What permissions mean on directories

On a directory, r lets you list names, x lets you enter it and reach entries by name, and w lets you create, delete and rename entries, but only together with x. That is why directories almost always need execute and why deleting a file depends on its directory's permissions, not its own. Unix also checks classes in order: if you own the file, only the owner bits apply, even when the group or others are granted more.

Special bits: setuid, setgid and sticky

Setuid on a compiled program makes it run with the file owner's privileges, which is how passwd edits system files. Setgid on a directory makes new files inherit the directory's group, the usual setup for shared team folders (2775). The sticky bit on a directory such as /tmp (1777) stops users from deleting each other's files even though everyone can write there.

umask is a mask, not a subtraction

When a program creates a file it usually requests 666 (or 777 for directories), and the kernel clears every bit set in your umask. With umask 022, files become 644 and directories 755. Because it is a bitwise mask, umask 033 gives files 644, not 633. The umask tab shows both directions, including which umask produces a given directory mode.

Recursive pitfalls

chmod -R 755 project makes every file inside executable too. A safer approach sets directories and files separately with find -type d and find -type f, or uses a capital X so execute lands only on directories.

Avoid chmod 777
Making a file or directory world-writable lets any user on the system change or replace it. Pick the narrowest mode that works, such as 750 for a directory shared with one group, or 1777 when everyone genuinely needs a drop folder.

Frequently Asked Questions

Is the Chmod Calculator free?

Yes, Chmod Calculator is totally free :)

Can I use the Chmod Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Chmod Calculator?

Yes, any data related to Chmod Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this chmod calculator work?

One permission mode is shown as a clickable bit grid, an octal number and an ls -l string at the same time. Edit any of them and the others update. Everything runs in your browser as plain bit arithmetic, so nothing is uploaded.

What does chmod 755 mean?

Each digit is the sum of read (4), write (2) and execute (1) for the owner, group and others. 755 gives the owner rwx (4+2+1) and gives group and others r-x (4+1), so it is written -rwxr-xr-x in ls -l output.

What is the difference between 644 and 755?

644 (rw-r--r--) lets the owner read and write and everyone else only read. It suits regular files. 755 adds execute for everyone, which you need for scripts, binaries and directories, because x on a directory is what lets you enter it.

What does a capital S or T mean in ls -l output?

A lowercase s or t means the special bit (setuid, setgid or sticky) is set and the execute bit under it is also set. A capital S or T means the special bit is set but execute is not, which is usually a mistake on files.

Why is chmod -R 755 on a directory a bad idea?

It also makes every regular file inside executable. Use find with -type d and -type f to set directories and files separately, or use a capital X (chmod -R u=rwX,go=rX), which adds execute only to directories and to files that already have it.

Why does SSH say my key permissions are too open?

OpenSSH refuses to use a private key that the group or others can read, and prints UNPROTECTED PRIVATE KEY FILE. Run chmod 600 on the key (or 400) and chmod 700 on the ~/.ssh directory.