Engineering calculators

Chmod Calculator

Updated Jun 30, 2026 By Jehan Wadia
Rate Formulas

Common Permission Presets

777 grants full read, write, and execute to everyone — a serious security risk. Use only when absolutely necessary.

Permission Matrix

Toggle Read, Write, and Execute for each class. Octal weights: Read = 4, Write = 2, Execute = 1.
Permission Owner (u) Group (g) Others (o)
Read 4
Write 2
Execute 1
Octal digit 7 5 5

Special Permission Bits

Run file as the file owner
Run file as the group owner
Restrict deletion to file owner
Special octal digit: 0

Octal, Symbolic & Binary (live two-way sync)

3 digits (e.g. 755) or 4 digits with special bits (e.g. 4755, 0644).
9 characters using r, w, x and - (s/S and t/T allowed for special bits).

Command Builder

Output Mode
No flag — show error messages only.
Output a diagnostic for every file processed.
Like verbose, but only report when a change is actually made.
Suppress most error messages.
Command Modifiers
Apply changes to all files and directories recursively.
Fail to operate recursively on the root directory /.
Use a reference file's mode instead of a numeric value.

Octal Command
Symbolic Command

Permission Summary

Owner (u)
Group (g)
Others (o)

File Listing Preview (ls -l)

File
Directory

Step-by-Step Solution


Introduction

The Chmod Calculator helps you set file permissions on Linux and Unix systems. Chmod is a command that controls who can read, write, or run a file. Every file has three groups of users: the owner, the group, and others. Each group can be given different levels of access.

This tool lets you build chmod commands in two ways. You can click checkboxes in the permission matrix, or you can type an octal value like 755 or a symbolic notation like rwxr-xr-x. All fields stay in sync, so a change in one spot updates everything else right away. The calculator also handles special permission bits like setuid, setgid, and the sticky bit.

Once you pick your permissions, the tool gives you a ready-to-use terminal command. You can add flags like -R for recursive changes or -v for verbose output. A step-by-step breakdown shows you the math behind each octal digit, so you can learn how chmod values work instead of just copying them. If you also manage network configurations on these systems, our Subnet Calculator and CIDR Calculator are useful companion tools for IP addressing tasks.

How to Use Our Chmod Calculator

Enter your desired file permissions using checkboxes, octal numbers, or symbolic notation. The calculator will show you the matching chmod command, permission summary, and a step-by-step breakdown of how the value is built.

Quick Presets: Click any preset button like 644 or 755 to instantly load a common permission setup. This is the fastest way to get started.

Permission Matrix: Check or uncheck the boxes for Read, Write, and Execute under Owner, Group, or Others. The octal digit for each column updates right away.

Special Permission Bits: Toggle Setuid, Setgid, or Sticky Bit on or off if your file needs advanced permissions. Most users can leave these off.

Octal / Numeric Field: Type a 3-digit or 4-digit octal value like 755 or 4755. The checkboxes and all outputs will sync to match. Turn on the Show 4-digit toggle to always display the leading special-bit digit. If you frequently work with other numeral systems, our Hex Calculator can help you convert between hexadecimal, decimal, and octal values.

Symbolic Notation Field: Type a 9-character string like rwxr-xr-x using the letters r, w, x, and dashes. Use s, S, t, or T in the execute spots to set special bits. All other fields update instantly.

Filename / Path: Type the name or path of your file or folder. This text is used in the generated chmod commands shown below.

Output Mode: Pick Default, Verbose (-v), Changes (-c), or Silent (-f) to add a flag that controls what chmod prints when it runs.

Command Modifiers: Check Recursive (-R) to apply permissions to all files inside a folder. Check Preserve Root to block changes to the root directory. Check Reference File to copy permissions from another file instead of setting them manually.

Calculate & Reset: Click Calculate to refresh all results, or click Reset to return every field to its default value of 755.

Results: After you set your permissions, the calculator shows the ready-to-use octal and symbolic chmod commands with a copy button, a binary breakdown, a permission summary for each user class, an ls -l preview for files and directories, and a step-by-step solution that explains the math behind each octal digit.

What Is Chmod and How Do File Permissions Work?

Chmod stands for "change mode." It is a command used in Linux and Unix systems to set who can read, write, or run a file. Every file and folder on these systems has a set of permissions that controls access. Chmod lets you change those permissions.

The Three Permission Types

Each file has three basic permissions:

  • Read (r) — Allows viewing the contents of a file or listing a folder.
  • Write (w) — Allows changing or deleting a file or adding files to a folder.
  • Execute (x) — Allows running a file as a program or entering a folder.

The Three User Classes

Permissions are set for three groups of people:

  • Owner (u) — The person who created the file.
  • Group (g) — A set of users who share access.
  • Others (o) — Everyone else on the system.

How Octal Numbers Work in Chmod

Chmod uses numbers to represent permissions. Each permission has a value: read = 4, write = 2, and execute = 1. You add these values together to get a single digit for each user class. For example, read + write + execute = 4 + 2 + 1 = 7. Read + execute = 4 + 1 = 5. Read only = 4.

A full chmod value has three digits, one for each class. So chmod 755 means the owner gets full access (7), while the group and others can read and execute but not write (5). Octal is a base-8 number system. If you need to work with base-16 values as well, our Hex Calculator handles hexadecimal conversions. For base-2 arithmetic, try the Binary Calculator.

Symbolic Notation

You can also write permissions as a nine-character string like rwxr-xr-x. The first three characters are for the owner, the next three are for the group, and the last three are for others. A dash (-) means that permission is turned off.

Special Permission Bits

Linux also has three special bits that add extra behavior:

  • Setuid (4000) — Runs a file with the permissions of the file's owner, not the person running it.
  • Setgid (2000) — Runs a file with the permissions of the file's group. On folders, new files inherit the group.
  • Sticky Bit (1000) — On shared folders, only the file's owner can delete their own files. The /tmp folder is a common example.

When special bits are used, the chmod value becomes four digits, like 1755.

Common Chmod Permission Examples

  • 644 — Owner can read and write. Everyone else can only read. Good for regular files.
  • 755 — Owner has full access. Everyone else can read and execute. Good for scripts and programs.
  • 700 — Only the owner has any access. Good for private files and folders.
  • 600 — Owner can read and write. No one else has access. Good for sensitive files.
  • 777 — Everyone has full access. This is a security risk and should be avoided in most cases.

Why File Permissions Matter

Setting the right permissions keeps your files safe. If permissions are too open, anyone on the system could read, change, or delete your data. If they are too strict, other users or programs that need access will not work correctly. Always give the least amount of access needed to get the job done.

File permissions are just one part of managing a Linux or Unix server. Administrators often configure permissions alongside networking tasks like subnetting and IP planning. If you work with network infrastructure, our Subnet Calculator, CIDR Calculator, VLSM Calculator, and Bandwidth Calculator can help you plan and troubleshoot your network setup. For storage reliability planning, check out the RAID Calculator to compare redundancy configurations for your drives.


Formulas used

Permission Octal Digit (per class)
D = R \times 4 + W \times 2 + X \times 1 \quad (R,W,X \in \{0,1\})
Special Bits Octal Digit
S = \text{Setuid} \times 4 + \text{Setgid} \times 2 + \text{Sticky} \times 1
Full Octal Mode
\text{Octal} = S \times 1000 + D_{\text{owner}} \times 100 + D_{\text{group}} \times 10 + D_{\text{others}}
Binary Representation (per class)
B = R \cdot 2^{2} + W \cdot 2^{1} + X \cdot 2^{0}

Frequently asked questions

What does chmod 644 mean?

Chmod 644 means the owner can read and write the file, while the group and others can only read it. No one can execute it. This is the most common setting for regular files like HTML pages or config files.

What does chmod 755 mean?

Chmod 755 gives the owner full access (read, write, and execute). The group and others can read and execute but cannot write. This is the standard setting for scripts, programs, and directories.

What is the difference between octal and symbolic notation?

Octal notation uses numbers like 755. Each digit represents a user class (owner, group, others), and the digit is the sum of read (4), write (2), and execute (1). Symbolic notation uses letters like rwxr-xr-x. Both describe the same permissions in different formats. This calculator converts between them instantly.

Is chmod 777 safe to use?

No. Chmod 777 gives every user on the system full read, write, and execute access. This is a serious security risk. Anyone could change or delete the file. Only use 777 for temporary testing, and switch to a safer value like 755 or 644 as soon as possible.

What does the -R flag do in chmod?

The -R flag stands for recursive. It applies the permission change to the target folder and every file and subfolder inside it. Be careful with this flag, especially when combined with broad permissions, because it changes everything at once.

What is the sticky bit?

The sticky bit (octal 1000) is a special permission for shared folders. When it is set, only the owner of a file can delete or rename that file, even if others have write access to the folder. The /tmp directory on Linux uses the sticky bit.

What is the difference between setuid and setgid?

Setuid (octal 4000) makes a file run with the permissions of the file's owner, not the user who runs it. Setgid (octal 2000) makes a file run with the permissions of the file's group. On directories, setgid causes new files to inherit the directory's group.

How do I read an ls -l output?

The ls -l command shows a string like -rwxr-xr-x. The first character is the file type (- for file, d for directory). The next nine characters are permissions in three groups of three: owner, group, and others. Each group shows read (r), write (w), and execute (x), or a dash if that permission is off.

What is the difference between 3-digit and 4-digit chmod values?

A 3-digit value like 755 sets the basic read, write, and execute permissions. A 4-digit value like 4755 adds a leading digit for special bits (setuid, setgid, sticky bit). If no special bits are needed, the leading digit is 0, so 0755 and 755 are the same.

What chmod should I use for a website folder?

Most website folders should use 755. This lets the owner make changes while allowing the web server to read and access the folder. For files inside, 644 is standard. Avoid 777 on any web-facing file or folder because it opens your site to attacks.

What does the --preserve-root flag do?

The --preserve-root flag stops chmod from running recursively on the root directory (/). This is a safety feature. Changing permissions on the entire root filesystem can break your system. Use this flag whenever you run chmod -R to add a layer of protection.

Can I copy permissions from another file?

Yes. Use the --reference=RFILE option. This tells chmod to copy the permissions from the reference file instead of using a number or symbolic value. In this calculator, check the Reference File box under Command Modifiers to add this flag to your command.

What is the difference between verbose and changes mode?

Verbose (-v) prints a message for every file that chmod processes, whether the permissions changed or not. Changes (-c) only prints a message when a file's permissions are actually different from what they were before. Use -c if you only want to see what was updated.

What does s and S mean in symbolic notation?

A lowercase s in the owner's execute position means setuid is on and execute is on. An uppercase S means setuid is on but execute is off. The same pattern applies to the group's execute position for setgid. For others, t and T work the same way for the sticky bit.

Why does my script say permission denied?

This usually means the file does not have execute permission for your user class. Run ls -l to check the current permissions. If you are the owner, you need at least chmod 700 or chmod u+x to run the script. Use this calculator to find the right value.

How is the octal digit calculated for each user class?

Each permission has a weight: read = 4, write = 2, execute = 1. Add up the weights of the permissions that are turned on. For example, read + execute = 4 + 1 = 5. The calculator's step-by-step section shows this math for every digit.