handy.moe

All tools / Debug tools

A stapler

Chmod calculator

Tick read, write and execute for owner, group and everyone, or type 755 or rwxr-xr-x, and get the chmod command, with an explanation in plain words.

Runs in your browser. Pasted data never leaves it.

Read (4)
Write (2)
Execute (1)
Owner (user)
Group
Everyone else
Special

How to use it

  1. Tick the permission boxes, type an octal number such as 755, or type a symbolic string such as rwxr-xr-x. They all stay in sync.
  2. Read the plain-English explanation underneath.
  3. Copy the chmod command.

Questions

How do the numbers work?

Each digit is the sum of read = 4, write = 2 and execute = 1, for the owner, the group and everyone else in turn. So 7 = 4+2+1 (read, write, execute), 5 = 4+1 (read, execute), 6 = 4+2 and 0 = nothing. 755 means the owner can do everything and everyone else can read and execute.

What does execute mean for a directory?

On a folder, execute (x) means “may enter it and reach the files inside by name”. Without it you can't open anything in the folder even if you can list it. That's why folders usually are 755 and files 644.

What are setuid, setgid and sticky?

A fourth, leading digit: 4 = setuid (the program runs as its owner), 2 = setgid (runs as its group, or new files in a folder inherit the group), 1 = sticky (in a shared folder such as /tmp, only a file's owner can delete it). Setuid programs are a security risk: don't set it unless you know why.

Is 777 ever right?

Almost never. It lets every user on the machine change or replace the file. If a website or app says “set permissions to 777”, the real fix is usually to set the right owner (chown) and use 755 or 775 for folders and 644 or 664 for files.

How do I apply it?

chmod 755 file, or recursively chmod -R 755 folder. To set folders and files differently: find . -type d -exec chmod 755 {} + and find . -type f -exec chmod 644 {} +. On Windows, chmod only matters inside WSL or Git Bash.

Is what I paste or test sent anywhere?

No. This page works entirely inside your browser, and pasted data never leaves your device. It makes no network requests while you use it, and the page also tells your browser to block them (a Content-Security-Policy with connect-src 'none'), so even a bug could not send your data out. To check it yourself, open your browser's developer tools, go to the Network tab, and use the tool: nothing will appear. There is no account, no analytics and no logging.