Eskillsfy

Home / Blog / Developer

Developer · 23 Nov 2026

Chmod Calculator: how it works and how to build one

Work out Linux file permissions in numbers and letters. This guide explains what happens behind the button and shows the code, so you can build your own.

What it does

Tick read, write and execute for owner, group and others and get the number (755) and the letters (rwxr-xr-x), or type a number to see what it allows. Includes the chmod command to copy.

When to use it

  • Fixing ‘permission denied’ errors
  • Securing SSH keys (600)
  • Web server files (644/755)

How to use it

  1. Tick permissions or type a number like 644.
  2. Read the symbolic form.
  3. Copy the chmod command.

Try it free in your browser, nothing is uploaded: https://eskillsfy.com/tools/chmod-calculator

How it works

Unix permissions are three groups (owner, group, others) of three bits: read = 4, write = 2, execute = 1. Adding the bits gives one digit per group, so rwx = 7 and r-x = 5, making 755.

The symbolic form just writes each bit as a letter or a dash.

Build it yourself

Here is the core of the tool. It has no dependencies unless noted, so you can paste it into any TypeScript or JavaScript project.

chmod.ts (ts)

export const toSymbolic = (octal: string) =>
  [...octal].map((d) => { const n = +d; return (n & 4 ? "r" : "-") + (n & 2 ? "w" : "-") + (n & 1 ? "x" : "-"); }).join("");

export const toOctal = (sym: string) =>
  [0, 3, 6].map((i) => (sym[i] === "r" ? 4 : 0) + (sym[i + 1] === "w" ? 2 : 0) + (sym[i + 2] === "x" ? 1 : 0)).join("");

toSymbolic("755"); // "rwxr-xr-x"

Make it production-ready

  • Add the special bits (setuid, setgid, sticky) as a fourth digit.

Questions

What should I use for a website?

Usually 644 for files and 755 for folders.

Try the Chmod Calculator

Free, runs in your browser, nothing is uploaded.

Open it
Keep reading

More in Developer

All posts