Chmod calculator — convert between 755, rwxr-xr-x and checkboxes

Tick read, write and execute for owner, group and others, or type a mode such as 644 or -rwxr-x---, and the calculator gives the octal number, the ls-style string, a per-user breakdown and a ready chmod command.

Live demo · real result from this tool
Set permissions by
Octal755
Symbolic
rwxr-xr-x
Command
chmod 755 script.sh

Table

WhoReadWriteExecuteDigit
Owneryesyesyes7
Groupyesnoyes5
Othersyesnoyes5

Symbolic chmod form

chmod u=rwx,g=rx,o=rx script.sh

Processed on your device — nothing is uploaded.

How to use the chmod calculator

  1. Choose Set permissions by: Checkboxes or Octal or symbolic value.
  2. With checkboxes, tick the boxes from Owner — read to Others — execute, plus setuid, setgid or Sticky bit if needed. The defaults give 755.
  3. With a value, type it into Value: 755, 0644, 4755, rwxr-xr-x or a full ls string such as -rw-r--r--. The leading file-type character is ignored.
  4. Set File name for the command, then copy the octal, the symbolic string or the chmod line.

What it does and when to use it

Unix permissions appear in two shapes. ls -l prints -rwxr-x---, but chmod, Dockerfiles, Ansible mode: and many deploy guides use numbers such as 0750. A wrong mode can leave a secret world-readable or make a script fail with “Permission denied”. This calculator turns either form into the other and shows each user class separately.

Typical cases: an SSH private key that must be 600, a deploy script that should run only for its owner and group, a shared upload folder where new files keep the group (setgid), or checking that nothing is world-writable. For other shell commands, see the Linux Commands Ref.

How it works

Permissions are 12 bits, as defined for chmod in POSIX. Each octal digit packs three bits:

r = 4   w = 2   x = 1
owner rwx = 4+2+1 = 7   group r-x = 4+0+1 = 5   others --- = 0

The special bits sit in front: setuid 4000, setgid 2000, sticky 1000. In the ls string they replace the execute letter of owner, group or others with s/S or t/T. The tool also prints the same mode as a symbolic chmod argument (u=…,g=…,o=…). It warns when others can write, and when setuid is set. It all runs in your browser and changes no files.

Worked examples

An SSH key. Value 600, file ~/.ssh/id_ed25519:

Octal: 600
Symbolic: rw-------
chmod 600 ~/.ssh/id_ed25519

OpenSSH refuses to use a private key that others can read.

Reading an ls line. Value -rwxr-x--- gives Octal: 750 and chmod u=rwx,g=rx,o= deploy.sh. The owner can edit and run, the group can run, others have no access.

A shared folder. Value 2775 gives Symbolic: rwxrwsr-x. The s in the group slot is setgid: on a directory, new files take the directory’s group, so a team can share it.

Limits and tips

  • The u=…,g=…,o=… form adds s for setuid or setgid and ,+t for the sticky bit, so 4755 gives u=rwxs,g=rx,o=rx.
  • A file name with spaces or shell characters is wrapped in single quotes in the commands.
  • Your umask, ACLs (setfacl) and file ownership also decide access; this tool does not see them.
  • To see why the digits work, try the bit patterns in Binary Arithmetic. After changing the execute bit on a tracked file, commit it like any change; the Git Cheatsheet lists the commands.

Frequently asked questions

What do 644 and 755 mean?
Each digit is one user class, owner then group then others, and is the sum of read 4, write 2 and execute 1. 644 is rw-r--r--, usual for normal files. 755 is rwxr-xr-x, usual for scripts and directories.
What does execute mean on a directory?
On a directory, x lets you enter it and reach files inside by name. r lets you list its contents. A web server usually needs x on every directory in the path.
What is a four-digit mode such as 4755?
The first digit holds the special bits, setuid 4, setgid 2 and sticky 1. 4755 is rwsr-xr-x, 2775 is rwxrwsr-x and 1777 is rwxrwxrwt, the usual mode of /tmp.
Why does ls show a capital S or T?
The special bit is set but the matching execute bit is not. rwSr--r-- is setuid without owner execute, which is rarely useful. The calculator reads and writes these forms.
Does Git keep these permissions?
Git records only whether a file is executable, as mode 100644 or 100755. Other bits, and setuid or sticky, are not stored in the repository.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close