# Chmod Calculator

URL: https://hifreetools.com/developer/chmod-calculator

> Tick read, write and execute for owner, group and other to instantly get the octal permission value, the symbolic rwx string and the exact chmod command.

## Quick answer

A chmod calculator turns Unix file permissions into the octal number you pass to chmod. Each of owner, group and other gets a digit found by adding read=4, write=2 and execute=1. So rwx (4+2+1)=7 and r-x (4+1)=5, giving 755 for rwxr-xr-x. Type an octal value and it fills the checkboxes back, or tick boxes to build the number.

Unix permissions are stored as three groups of three bits: owner, group and other. Within each group, read is worth 4, write is worth 2 and execute is worth 1. Add the values of the permissions you want for a group to get a single octal digit from 0 to 7 (for example read + execute = 4 + 1 = 5). Concatenate the three digits in owner-group-other order to get the full octal mode such as 755. The symbolic string is built by writing r, w or x where a permission is granted and a dash where it is not, e.g. rwxr-xr-x. The tool works in both directions: ticking the nine checkboxes recomputes the octal and symbolic output live, while typing a 3-digit octal value (each digit 0-7) fills the checkboxes back in. The ready-to-run command is simply chmod followed by the octal value and your filename.

## Examples

- Standard directory / script: 755: Owner: read, write, execute. Group: read, execute. Other: read, execute. → Octal 755 - symbolic rwxr-xr-x - command: chmod 755 filename
- Regular non-secret file: 644: Owner: read, write. Group: read. Other: read. → Octal 644 - symbolic rw-r--r-- - command: chmod 644 filename
- Private key / secret: 600: Owner: read, write. Group: none. Other: none. → Octal 600 - symbolic rw------- - command: chmod 600 filename
- Fully open: 777: Owner, group and other all have read, write and execute. → Octal 777 - symbolic rwxrwxrwx - command: chmod 777 filename

## FAQ

**What does chmod 755 mean?**
755 means the owner has read, write and execute (7 = 4+2+1) while the group and other users have read and execute only (5 = 4+1). The symbolic form is rwxr-xr-x. It is the standard mode for directories and executable scripts that everyone is allowed to run but only the owner can change.

**What is the difference between 755 and 644?**
755 (rwxr-xr-x) grants execute permission to everyone, which directories and runnable scripts need. 644 (rw-r--r--) has no execute bits and is meant for ordinary files like documents, HTML and config files: the owner can edit them and everyone else can only read them.

**How is the octal permission number calculated?**
For each of owner, group and other you add read=4, write=2 and execute=1 for the permissions you want, giving one digit from 0 to 7. Writing the three digits in owner-group-other order gives the full mode. For example rw- = 4+2 = 6 and r-- = 4, so rw-r--r-- is 644.

**What does the symbolic string like rwxr-xr-x mean?**
It is the permissions shown in three blocks of three characters: owner, group, then other. Within each block r, w and x mean read, write and execute are granted, and a dash means they are not. So rwxr-xr-x is owner rwx, group r-x, other r-x, which equals octal 755.

**Why does chmod 777 get flagged as insecure?**
777 (rwxrwxrwx) gives read, write and execute to absolutely everyone, including write access for other users on the system. That means any account can modify or replace the file, so it is almost never the right choice. Prefer the least permission that works, such as 755 or 644.

**What permission should a private SSH key have?**
600 (rw-------). SSH refuses to use a private key if its permissions are too open, because a key readable by other users is a security risk. 600 gives read and write to the owner only and no access to anyone else.

**Does this calculator handle the leading setuid/sticky digit?**
This tool covers the standard three-digit mode (owner, group, other) that you use the vast majority of the time. The optional fourth leading digit for setuid, setgid and the sticky bit is a separate special-bits topic and is not included here.


## Sources

- [man7.org - chmod(1) manual page](https://man7.org/linux/man-pages/man1/chmod.1.html)
- [Wikipedia - File-system permissions](https://en.wikipedia.org/wiki/File-system_permissions)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Chmod Calculator", https://hifreetools.com/developer/chmod-calculator
