Common permissions

Permissions

Read (4)Write (2)Execute (1)Sum
owner7
group5
other5

Special bits

Generated command

$chmod 755 file.sh
Privacy: Calculation runs entirely in your browser via JavaScript bitwise arithmetic. Zero HTTP requests — verify in DevTools' Network tab.

About Chmod Calculator

A chmod calculator converts Unix/Linux file permissions between three equivalent representations: symbolic (`rwxr-xr-x`), octal (`755`), and a checkbox grid (owner/group/other × read/write/execute). Updating any one updates the others. Also supports the special bits — setuid, setgid, sticky — which appear as a fourth octal digit and modify the symbolic representation (e.g., `rwsr-xr-x` for setuid).

Why use a Chmod Calculator?

Remembering octal codes by heart is error-prone (`755` vs `775` vs `750` — each has very different security implications). The checkbox grid makes intent explicit, the symbolic form is what `ls -l` displays, and the octal form is what `chmod` accepts on the command line. Generating the exact `chmod 755 file.sh` command eliminates typos and the common mistake of running `chmod 777 file.sh` (which makes the file world-writable — a serious security issue).

Who is it for?

Developers SSH'ing into servers, sysadmins managing file permissions on Linux/macOS, web developers debugging file-upload permissions (the classic 'why does my upload directory have wrong permissions?' issue), DevOps engineers writing Ansible/Terraform configs, and students learning Unix.

How to use the tool

1

Use any of three input modes: octal (3 or 4 digits), symbolic (`rwxr-xr-x` or `-rwxr-xr-x`), or check/uncheck the owner/group/other read/write/execute boxes

2

Optionally enable special bits: setuid (suid), setgid (sgid), sticky bit

3

Read the equivalent representation in the other modes (all three stay in sync)

4

Copy the generated `chmod` command (e.g., `chmod 755 file.sh`) for use in your terminal

5

Cross-reference common permission patterns (755 for executables, 644 for files, 600 for SSH keys)

Frequently Asked Questions

How do I calculate Unix chmod permissions?

Three equivalent representations of the same data. **Octal**: `755` = owner 7 + group 5 + other 5, where each digit's bits encode read (4) + write (2) + execute (1). **Symbolic**: `rwxr-xr-x` — same as `755` but as 9 characters (or 10 with the leading file-type character from `ls -l`). **Checkbox**: 3×3 grid (owner/group/other × read/write/execute). The tool lets you edit any of the three; the other two update live. Runs entirely in your browser — pure arithmetic, zero HTTP requests.

What is chmod?

`chmod` (change mode) is the Unix command for setting file permissions. Usage: `chmod 755 file.sh` (octal mode) or `chmod u+x file.sh` (symbolic, 'add execute for user'). Defined by POSIX. Three permission classes — **u** (user/owner), **g** (group), **o** (other) — and three permission types — **r** (read), **w** (write), **x** (execute). For directories: `r` = list contents, `w` = create/delete entries, `x` = enter the directory. Read-without-execute on a directory is meaningless (you can't `cd` into it).

Is my data sent to a server?

No — calculation runs entirely in your browser via JavaScript bitwise arithmetic. No data ever reaches a server, no logging. Verify in DevTools' Network tab: zero HTTP requests during calculation. Safe for inspecting permissions on sensitive paths (production server file modes, SSH key permissions, etc.).

What does 755, 644, 777 mean?

Common octal patterns. **755** (`rwxr-xr-x`): owner read+write+execute, group/other read+execute. Standard for executables and directories. **644** (`rw-r--r--`): owner read+write, group/other read-only. Standard for regular files. **600** (`rw-------`): owner read+write only. Required for SSH private keys (`~/.ssh/id_*`). **700** (`rwx------`): owner full access, others nothing. For private directories like `~/.ssh`. **777** (`rwxrwxrwx`): everyone read+write+execute. **DON'T USE 777** — it means any user can modify or delete the file. Use 755 or 750 instead.

What are setuid, setgid, and the sticky bit?

Special permission bits, written as a 4th leading octal digit (`4755`, `2755`, `1777`). **setuid** (4, `s` in user-execute position): executable runs as the file's owner, not the invoker. Used for `passwd`, `sudo`. **Security risk** if applied to writable files. **setgid** (2, `s` in group-execute position): on executables, runs as the group; on directories, new files inherit the group. **Sticky bit** (1, `t` in other-execute position): on directories like `/tmp`, only the file's owner can delete files in it (otherwise anyone could delete others' files). When the underlying execute bit is unset, the special bit shows as uppercase (`S`, `T`).

Why is 777 (`chmod 777`) dangerous?

777 = `rwxrwxrwx` = anyone on the system can read, modify, or delete the file. On a shared server, that means: other users' processes can corrupt your data; if a privilege-escalation exploit exists, it's easier to chain through your files; web-server processes (running as `www-data` or `nginx`) can write to it — making any uploaded file a potential script execution. For 'I don't know what to use' situations, the safer defaults are: **755** for directories and executables, **644** for files, **600** for secrets. Never use 777 in production; rarely needed even in development.

What's the difference between chmod and umask?

**chmod** sets permissions on an EXISTING file. **umask** controls the default permissions of NEW files. umask is a 3-digit octal MASK that's subtracted from the default (typically 666 for files, 777 for directories). Example: umask=022 → new files get 644 (666 − 022), new directories get 755 (777 − 022). The umask=002 (common on multi-user development servers) gives 664 / 775 — group-writable. Display current umask: `umask`. Set umask: `umask 022` (session-only) or in `~/.bashrc` (persistent).

How do I set permissions for a directory tree recursively?

`chmod -R` applies to all files and subdirectories. But there's a gotcha: applying the SAME mode to files AND directories often breaks things. `chmod -R 755 dir/` makes directories executable (needed to enter them — good) AND makes regular files executable (NOT needed — security smell). Better approach: separate file and directory rules. **Files**: `find dir -type f -exec chmod 644 {} \;`. **Directories**: `find dir -type d -exec chmod 755 {} \;`. Or use `find … -exec chmod a-x,a+rX {} \;` — capital `X` means 'execute only if it's a directory or already executable for someone'.

Share This Tool

Found this tool helpful? Share it with others who might benefit from it!

💡 Help others discover useful tools! Sharing helps us keep these tools free and accessible to everyone.

Support This Project

Buy Me a Coffee