# Chmod Calculator

- **URL:** https://codeasystem.com/calculators/developer/chmod-calculator/
- **Category:** developer
- **Description:** Convert Unix file permissions between symbolic (rw-r--r--) and octal (644) notation with a per-class numeric breakdown.
- **Primary output:** Octal notation: 644

## Inputs
- Permission mode (name: `mode`, type: text, example: rw-r--r-- or 644)
- Convert (name: `direction`, type: select)

## Outputs
- Octal notation: 644
- Symbolic notation: rw-r--r--
- Octal notation: 644
- Owner (6 = rw-): Owner read/write/execute flags
- Group (4 = r--): Group read/write/execute flags
- Others (4 = r--): Others read/write/execute flags

## Formula / methodology
```
digit = read(4) + write(2) + execute(1), summed per owner/group/other triad
```

Each permission class; owner, group, others; maps read to 4, write to 2 and execute to 1; the digit is their sum. Symbolic strings are parsed character-by-character into these sums, and octal digits expand back into r/w/x flags.

## Assumptions & limitations
- Exactly nine symbolic characters or exactly three octal digits.
- Special bits (setuid, setgid, sticky) are not modeled.
- Directories interpret x as traversal permission.

## How to use
1. **Choose the direction**; Symbolic→octal for scripting; octal→symbolic when reading ls -l output.
2. **Enter the mode**; Either notation is validated strictly; malformed input explains what went wrong.
3. **Apply with chmod**; Run chmod 644 file (or the symbolic equivalent shown) on your target.

## Example
The everyday web-server mode rw-r--r-- converts to octal 644: the owner reads and writes while everyone else merely reads.

Result for these inputs:

```
Octal notation: 644
```

## About this calculator
### Reading ls -l quickly

The first ten characters of ls -l output encode file type plus nine permission flags in three triads. With practice, spotting 755-versus-644 mistakes; world-writable files, missing execute bits on scripts; takes seconds.

### Common modes worth memorizing

- 600; private key files: owner read/write only
- 644; ordinary files: owner writes, world reads
- 700; private directories: owner-only traversal
- 755; executables and public dirs: everyone runs, owner writes

## FAQs
### Why is my script “Permission denied”?

It lacks the execute bit. Add x for the relevant classes; chmod +x script.sh, or octal 755/700 depending on audience.

### What does chmod 777 mean and should I use it?

Everyone can read, write and execute. Almost never appropriate outside throwaway containers; it invites tampering.

### How do setuid/sticky bits fit in?

They form a fourth leading octal digit (e.g. 1755 for sticky). This calculator models standard three-digit modes only.

## Related calculators
- [Subnet & CIDR Calculator](https://codeasystem.com/calculators/developer/subnet-cidr-calculator/)
- [MIME Type Lookup](https://codeasystem.com/calculators/developer/mime-type-lookup/)
- [Download Time Calculator](https://codeasystem.com/calculators/developer/download-time-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/developer/chmod-calculator/)
