chmod-calculator

Chmod Calculator

Select permissions for user, group, and others to generate numeric and symbolic chmod values.

Read (4) Write (2) Execute (1)
User
Group
Others

Numeric

000

Symbolic

---------

Command

chmod 000 filename

Common Values

  • 644 = rw-r--r--
  • 755 = rwxr-xr-x
  • 775 = rwxrwxr-x
  • 700 = rwx------

chmod Calculator

Intro

Calculate Linux file and directory permissions in numeric and symbolic format.

This chmod calculator helps you understand and generate permission values for files and directories using standard Linux permission bits. Instead of manually adding read, write, and execute values, you can select permissions for user, group, and others and instantly see the numeric mode, symbolic mode, and example chmod command.

This is especially useful when you need to:

  • set file permissions correctly
  • troubleshoot access problems
  • understand numeric chmod values
  • compare symbolic and octal permissions
  • avoid overly permissive file modes
  • apply safer defaults on Linux servers

What Is chmod?

chmod is the Linux and Unix command used to change file and directory permissions.

It controls what these classes of users can do:

  • user — the file owner
  • group — members of the file’s group
  • others — everyone else

The three standard permission types are:

  • read (r) = 4
  • write (w) = 2
  • execute (x) = 1

How chmod Values Work

Each permission set is built by adding the values for read, write, and execute.

Examples:

  • 4 = read
  • 2 = write
  • 1 = execute
  • 6 = read + write
  • 7 = read + write + execute
  • 5 = read + execute

A full chmod value uses three digits:

  • first digit = user
  • second digit = group
  • third digit = others

For example:

  • 755 = rwxr-xr-x
  • 644 = rw-r--r--
  • 700 = rwx------

That means:

  • 755 gives the owner full access, while group and others can read and execute
  • 644 gives the owner read and write access, while group and others can only read
  • 700 gives access only to the owner

Numeric vs Symbolic Permissions

Linux permissions are often shown in two formats.

Numeric Mode

Numeric mode uses three octal digits such as:

  • 644
  • 755
  • 775
  • 700

This format is compact and commonly used with the chmod command.

Symbolic Mode

Symbolic mode shows the actual permission letters, such as:

  • rw-r--r--
  • rwxr-xr-x
  • rwxrwxr-x
  • rwx------

This format is easier to read when you want to understand what the numeric value actually means.

Common chmod Values

Some permission values appear constantly in Linux administration.

644

rw-r--r--

Use 644 for:

  • regular text files
  • config files that should not be executable
  • website files that need to be readable by the web server
  • scripts that should not be run directly

This is one of the most common file permission settings.

755

rwxr-xr-x

Use 755 for:

  • directories
  • executable scripts
  • website directories
  • binaries or tools that need execute permission

This is one of the most common directory permission settings.

775

rwxrwxr-x

Use 775 when:

  • the owner and group both need write access
  • a shared deployment group manages files
  • collaborative environments need group write permissions

This can be useful, but should be applied carefully.

700

rwx------

Use 700 for:

  • private scripts
  • sensitive directories
  • admin-only files
  • user-specific SSH-related directories in some cases

This is useful when only the owner should have access.

When to Use 755 vs 644

A simple rule is:

  • use 755 for directories and executable files
  • use 644 for regular non-executable files

Why this matters:

  • directories usually need execute permission so users can enter or traverse them
  • regular files usually do not need execute permission unless they are meant to be run as programs or scripts

Examples:

Use 644 for:

  • .conf files
  • .txt files
  • .html files
  • .css files
  • .js files
  • most PHP files

Use 755 for:

  • directories
  • shell scripts that should be executable
  • deployment scripts
  • utility binaries

Why Directory Permissions Are Different

Directories use permissions a little differently than files.

For directories:

  • read lets you list directory contents
  • write lets you create, delete, or rename entries
  • execute lets you enter or traverse the directory

That is why a directory often needs execute permission even when a regular file does not.

A common mistake is giving a directory 644, which usually causes access problems because the execute bit is missing.

Common Linux Use Cases

Website Files

Typical web server setups often use:

  • 644 for files
  • 755 for directories

This allows files to be read while keeping directory traversal functional.

Shell Scripts

If a script should be run directly, it often needs execute permission.

Example:

  • 755 for a script that multiple users may run
  • 700 for a private admin-only script

Private User Files

Sensitive files are often more restrictive.

Examples include:

  • backup scripts
  • personal config files
  • private keys
  • user-only automation files

Shared Group Access

In collaborative environments, you may use values such as:

  • 664 for shared files
  • 775 for shared directories

This allows both the owner and group to write, while others get reduced access.

Common chmod Mistakes

Making Everything 777

777 gives read, write, and execute permissions to everyone.

This is usually a bad idea because it can:

  • weaken security
  • allow unintended file changes
  • create risky shared access
  • hide underlying ownership problems

Giving Execute Permission to Regular Files Unnecessarily

Not every file should be executable.

This can create confusion and lead to sloppy permission habits.

Using 644 on Directories

Directories usually need execute permission. Without it, users may not be able to enter the directory even if they can see it.

Ignoring Ownership Problems

Sometimes permissions are not the real issue. The file may simply belong to the wrong user or group.

In those cases, chown may need attention instead of chmod.

Applying Broad Permissions Recursively Without Review

Recursive permission changes can accidentally expose sensitive files or break expected application behavior.

Always check what you are changing before running recursive chmod commands.

How to Use chmod Safely

A safe workflow for changing permissions is:

  • identify whether the target is a file or directory
  • decide who actually needs access
  • use the least permissive mode that still works
  • review ownership as well as permissions
  • avoid 777 unless you fully understand the risk
  • test changes on non-critical files first when possible

Example commands:

chmod 644 filename
chmod 755 script.sh
chmod 755 directoryname

Best Practices for Linux File Permissions

When working with chmod, it helps to follow a few simple rules:

  • use 644 for most regular files
  • use 755 for most directories
  • only add execute permission when needed
  • use more restrictive modes for sensitive content
  • fix ownership issues separately when appropriate
  • avoid broad recursive permission changes without review
  • document unusual permission requirements in deployment notes

For production Linux servers, clean ownership and conservative permissions are usually safer than quick permission shortcuts.

Frequently Asked Questions

What does chmod mean?

chmod stands for “change mode” and is used to change file and directory permissions on Linux and Unix systems.

What is the difference between 755 and 644?

755 gives the owner full access and gives group and others read and execute permissions. 644 gives the owner read and write access and gives group and others read-only access.

Why do directories often use 755?

Because directories usually need execute permission so users and services can traverse them.

Why is 777 dangerous?

Because it gives everyone full access, including write permission, which can create major security and stability problems.

Should PHP files be 755 or 644?

In most cases, PHP files should be 644, not 755, unless there is a specific reason they need execute permission.

Is chmod enough to fix every access problem?

No. File ownership, group membership, ACLs, SELinux, and application-specific behavior can also affect access.

Related Tools

You may also find these tools useful:

Final Note

This chmod Calculator is useful for quickly converting Linux permission choices into numeric and symbolic formats without doing the math by hand.

Use it to understand what a permission value really means before you apply it. A small permission mistake can break scripts, block websites, or expose files more broadly than intended.