Get online today — Domain + Hosting at discounted prices View Combo Offers ›

chmod / File Permission Calculator

Convert between 755, rwxr-xr-x and symbolic chmod notation.

Enter permissions in any form — octal like 755, symbolic like rwxr-xr-x, or a chmod clause like u=rwx,go=rx — and get every other form back, along with what it actually allows.

Unsafe combinations are flagged. If you have been told to run chmod 777, read the warning before you do.

How it works

Every file on a Unix system carries nine permission bits, arranged as three groups of three. The groups are, in order, the owner of the file, the group it belongs to, and others — everyone else. Within each group the three bits are read (4), write (2) and execute (1), and the digit you see in 755 is simply those values added up: 7 is 4+2+1, 5 is 4+1.

What the execute bit means depends on what it is set on. On a file it means "this may be run as a program". On a directory it means something quite different: permission to traverse into it and reach what is inside. A directory with read but not execute lets you list the names of its contents and nothing else, which produces the memorable symptom of an ls that works and a cd that does not. This is why directories are normally 755 and files 644 — the directory needs its execute bit, the file does not.

Three further bits sit above the nine, shown as a leading fourth digit. setuid (4000) makes an executable run as its owner rather than the caller. setgid (2000) does the same for the group and, on a directory, makes new files inherit that directory's group — genuinely useful for shared folders. The sticky bit (1000) on a world-writable directory restricts deletion to each file's owner, which is what makes /tmp safe to share.

On a web server the rule of thumb is narrow: directories 755, files 644, and anything holding credentials — wp-config.php, .env — at 640 or 600. Scripts do not need the execute bit to be served by PHP; the interpreter reads them, it does not run them as programs. And 777 is almost never the answer. On shared hosting it means any other account on the machine can rewrite your code, and many servers now refuse to execute world-writable PHP at all, so it frequently makes the original problem worse.

Frequently asked questions

What permissions should a website use?

Directories 755 and files 644 as the default. Configuration files containing database credentials should be 640, or 600 where the web server runs as the file owner. Uploads directories need to be writable by the web server user, which is a question of ownership rather than of loosening the mode.

Is chmod 777 ever correct?

Essentially never on a web server. It grants write access to every account on the machine, and many hosts refuse to execute world-writable PHP files under suEXEC, so it often breaks the very thing it was meant to fix. If something needs to write, change the owner instead.

Why is 755 recommended for directories but 644 for files?

Because the execute bit means different things. On a directory it is permission to enter and reach the contents, so it is required. On an ordinary file it means "run this as a program", which a web page or an image never needs.

What does the fourth digit mean?

It carries setuid (4), setgid (2) and the sticky bit (1). Most files have none of them and the digit is simply left off. setgid on a directory is the genuinely handy one: new files inside inherit its group, which keeps a shared folder consistent.

What is the difference between chmod and chown?

chmod changes what the owner, the group and everyone else may do. chown changes who the owner and the group are. When a web application cannot write to a folder, the fix is usually chown to the web server user, not a looser chmod.

How does umask relate to this?

umask is a mask of bits removed from the default permissions of newly created files. A umask of 022 turns the 666 default for files into 644, and the 777 default for directories into 755. It affects creation only; it never alters an existing file.

Related tools

Need hosting that just works?

Free SSL, daily backups and 24×7 support on every Loudhost plan.

View Hosting Plans