Skip to content
{}
Unix & Linux file permissions

Chmod Permissions Calculator

Calculate octal (755, 644, 4755) and symbolic (rwxr-xr-x) Unix permissions with live two-way sync, special bits, security audit warnings, and ready-to-run chmod / find commands.

POSIX octal · symbolic · umask

Two-way octal & symbolic inputs

ls -l prefix:

4-digit: 0755 · Clause: u=rwx,go=rx

Accepts ls -l strings like -rw-r--r-- or drwxrwxrwt.

Live ls -l & Binary Preview
-rwxr-xr-x 1 user group file.sh
bits: 000 · 111 · 101 · 101
Standard · Safe Least Privilegeoctal 755 · -rwxr-xr-x

Mode 755 prevents group and public modification while allowing controlled read & execute.

  • Standard for shell scripts, binaries, and traversable web/application directories (755 / 750).

Permissions matrix (Owner / Group / Public)

Toggle Read (4), Write (2), and Execute (1) bits for each Unix class.

755
ClassRead (4)Write (2)Execute (1)OctalQuick
Owner (User) (u)
File owner
7
Group (g)
Owning group members
5
Public (Others) (o)
Every other local user
5

Special permission bits (leading 4th octal digit)

Lowercase s/t means the underlying execute bit is also enabled; uppercase S/T means execute is off.

Special: 0

Plain-English permission breakdown

  • Owner (u): read, write, execute/traverse (7)
  • Group (g): read, execute/traverse (5)
  • Public / Others (o): read, execute/traverse (5)

Ready-to-copy chmod commands

Customize target file or directory paths and copy exact POSIX commands.

  • Numeric (single path)
    chmod 755 file.sh

    Applies the exact octal mode to one file or directory.

  • Recursive directory
    chmod -R 755 ./dir

    Applies the mode to a directory and everything inside it.

  • Symbolic notation
    chmod u=rwx,go=rx file.sh

    Explicit human-readable owner/group/other permission clause.

  • Directories only (find)
    find ./dir -type d -exec chmod 755 {} +

    Sets traversable mode 755 on directories under ./dir without making files executable.

  • Regular files only (find)
    find ./dir -type f -exec chmod 644 {} +

    Sets non-executable mode 644 on regular files under ./dir while preserving directory traversal.

umask default-permission calculator

Computes newly created files (0666 & ~umask) and directories (0777 & ~umask).

100% local

Linux default: owner writes, group and others can read (files 644, dirs 755).

Common Unix & Linux permission presets

Click any preset to sync the matrix, octal/symbolic fields, security audit, and commands.

Active: 755 (rwxr-xr-x)

How to Use the Chmod Calculator

Click any checkbox in the Owner / Group / Public matrix or Special Bits row, or type an octal number (755, 0600, 4755, 1777) or symbolic ls -l string (rwxr-xr-x, -rw-r--r--, drwxrwxrwt) directly. Every representation — octal, symbolic, binary bits, security audit badge, and copy-ready chmod and find commands — stays in two-way sync locally in your browser.

Quick Reference: Common Unix & Linux Modes

Standard least-privilege permission modes used across Linux servers, containers, SSH, and web deployments.

InputOutputNote
400-r--------Read-only private keys (AWS .pem, TLS keys)
600-rw-------SSH private keys, .env secrets, credentials
644-rw-r--r--Web assets, source files, public configs
700drwx------Private directories such as ~/.ssh
755drwxr-xr-xExecutables, scripts, and web directories
1777drwxrwxrwtShared /tmp directory with Sticky Bit
4755-rwsr-xr-xSetUID executable (audit carefully)

Understanding umask Bitwise Calculation

Unlike naive subtraction, POSIX umask works by clearing bits with a bitwise mask (`0666 & ~umask` for files, `0777 & ~umask` for directories). That is why umask 022 gives 644/755, umask 027 restricts others completely (640/750), and umask 077 creates owner-only files and folders (600/700). Use the built-in umask calculator above to preview exact file and directory defaults before adding `umask 027` to your shell profile or systemd unit.

Web root hardening (separate dirs and files)

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

OpenSSH directory and key permissions

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/config
chmod 644 ~/.ssh/id_ed25519.pub

Set default umask for new files (640 / 750)

umask 027

Frequently Asked Questions

How do octal chmod numbers like 755, 644, and 600 work?

Each of the three digits represents Owner (u), Group (g), and Public/Others (o) in order. Every digit is the sum of three binary flags: Read = 4, Write = 2, and Execute = 1. For example, 7 = 4+2+1 (rwx), 5 = 4+0+1 (r-x), and 4 = 4+0+0 (r--), so 755 means rwxr-xr-x and 644 means rw-r--r--.

What does the leading 4th digit (SetUID 4, SetGID 2, Sticky Bit 1) do?

SetUID (4, u+s) runs an executable with the file owner's effective privileges. SetGID (2, g+s) runs executables with the file's group or forces new files inside a directory to inherit the directory's group. Sticky Bit (1, +t) on shared directories like /tmp (1777) prevents users from deleting or renaming files they do not own. Lowercase s/t means the underlying execute bit is on; uppercase S/T means execute is off.

Why is chmod 777 dangerous?

Mode 777 (rwxrwxrwx) makes a file or directory readable, writable, and executable by every local user and service account on the machine. If a web server process or low-privilege account is compromised, it can overwrite scripts, plant backdoors, or tamper with configuration. Use 755 for directories and scripts, 644 for static/config files, and 600 for private keys and secrets.

Why should I use find instead of chmod -R 755 on web directories?

Running chmod -R 755 sets the execute bit on every regular file (HTML, JSON, images, configs) inside the tree, which is unnecessary and violates least privilege. Running `find . -type d -exec chmod 755 {} +` followed by `find . -type f -exec chmod 644 {} +` keeps directories traversable while keeping data files non-executable.

How does umask differ from chmod?

chmod changes permissions on existing files, while umask sets a process-level bitmask of permissions to strip off newly created files and directories. Unix starts new regular files from 0666 and directories from 0777, then applies bitwise AND with the complement of umask (`base & ~umask`). For example, umask 022 produces 644 files and 755 directories, umask 077 produces 600 files and 700 directories, and umask 033 produces 644 files (not 633) because regular files do not start with execute bits.

Which permissions does OpenSSH require for keys and ~/.ssh?

OpenSSH refuses private keys that are readable by group or others. Set ~/.ssh to 700 (`chmod 700 ~/.ssh`), private keys like id_ed25519 to 600 (`chmod 600 ~/.ssh/id_ed25519`) or 400, and public keys / authorized_keys to 644 or 600.

Validators workflow

Continue with the data, not the directory

Validate, format, repair, compare, query, and reshape payloads before they ship.

Browse inspect, validate & repair