Chmod Calculator

Convert Linux file permissions between checkboxes, octal numbers like 755 and rwx notation.

Chmod Calculator tool

WhoRead (4)Write (2)Execute (1)
Owner (u)
Group (g)
Others (o)
Common modes
Numeric command
Symbolic command
Shown by ls -l
What this mode allows

    About the Chmod Calculator

    Setting the wrong file permissions on a web server can either break a site or leave files open to anyone. This chmod calculator converts between permission checkboxes, the octal numbers used by chmod and the rwx notation shown by ls -l: 755 means rwxr-xr-x, so the owner can change the file while everyone else can only read and run it, and 644 means rw-r--r--, typical for web pages. A ready-to-run command is shown too.

    Each digit of an octal mode is the sum of read (4), write (2) and execute (1), for the owner, the group and everyone else, in that order. So 755 means the owner can do everything while others can read and execute, and 644 means the owner can read and write while everyone else can only read. A plain-language explanation spells out what the current mode allows.

    The special bits are supported too: setuid and setgid, which run a program with the rights of its owner or group, and the sticky bit, which stops users deleting each other's files in shared folders such as /tmp. They add a fourth, leading digit, as in 4755 or 1777, and appear as s or t in the symbolic form. The calculator also writes the equivalent symbolic command, such as u=rwx,g=rx,o=rx.

    Presets cover the common modes for web hosting, scripts and SSH keys. For other server tasks, see the .htaccess generator and the cron expression generator, and to protect a folder with a password, the htpasswd generator.

    How to use the Chmod Calculator

    1. Tick the permissionsChoose read, write and execute for the owner, the group and others.
    2. Or type a modeEnter an octal number like 755 or a symbolic string like rwxr-xr-x.
    3. Add special bitsTick setuid, setgid or sticky if you need them.
    4. Copy the commandSet the file name, then copy the numeric or the symbolic chmod command.

    Chmod Calculator features

    • Checkboxes, octal and symbolic in sync
    • setuid, setgid and sticky bits
    • Numeric and symbolic chmod commands
    • ls -l style string for files and folders
    • Plain-language explanation
    • Warning for world-writable modes
    • Presets for 644, 755, 600 and more
    • Recursive option for folders

    Common uses

    • Fixing permission errors on a web server
    • Making a script executable
    • Securing SSH keys and configuration files
    • Reading ls -l output
    • Learning how Linux permissions work

    File permissions in practice: fixing a site after upload, ownership, writable folders, umask, scripts, Git and upload security

    By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

    Permissions decide who can read, change and run files on a Linux server. Most permission problems on websites come from two extremes: files set to 777 so anything can change them, or files the web server cannot read at all. This guide fixes a typical website after an upload, explains why ownership matters as much as the numbers, and covers writable folders, default permissions, scripts, Git and keeping upload folders safe.

    A worked example: fixing permissions after an upload

    After uploading a PHP site through an archive, every file is set to 777, a serious security risk. The standard fix sets folders to 755 and files to 644 using two commands run from the site's root:

    • find . -type d -exec chmod 755 {} \;
    • find . -type f -exec chmod 644 {} \;

    The configuration file containing database passwords is then tightened further, often to 640 or 600, so only its owner, and the group if needed, can read it. The site works exactly as before, but other users and compromised processes on the server can no longer modify it.

    Ownership matters as much as mode

    Permissions apply to the file's owner, its group and everyone else, so the same mode behaves differently depending on who owns the file. If the web server runs as one user and the files belong to another, 644 may stop the site writing its cache or uploads. Control panels such as CloudPanel typically run each site's PHP processes as that site's own user, so files owned by that user work with standard modes. Fixing ownership with chown is often the real solution when tempted to use 777.

    Writable folders

    Applications need a few folders they can write to, such as cache, session and upload folders. Grant write access to those folders only, for example 775 with the web server's group, and keep everything else read-only to the web server. Frameworks document exactly which folders need this, such as Laravel's storage and bootstrap/cache folders.

    Default permissions and umask

    New files get their permissions from a setting called the umask. With the common umask of 022, new files are created as 644 and new folders as 755. If newly uploaded or generated files keep appearing with the wrong permissions, the umask of the process creating them is usually the cause rather than the files themselves.

    What execute means for folders

    For a folder, read permission allows listing its contents, while execute permission allows entering it and reaching the files inside. A folder with read but no execute permission shows file names but blocks access to them. This is why folders need 755 while ordinary files need only 644.

    Scripts that will not run

    Running a script with ./deploy.sh fails with permission denied if the file lacks execute permission; chmod +x deploy.sh fixes it. The script also needs a first line naming its interpreter, such as a line beginning with #! followed by the path to bash, otherwise the system may not know how to run it.

    Git and permissions

    Git records only whether a file is executable, not its full mode. Scripts committed from Windows may lose their executable flag; git update-index --chmod=+x deploy.sh sets it inside the repository so everyone who clones receives an executable script.

    Upload folders

    Folders that accept user uploads should never allow uploaded files to run as code. Besides keeping uploaded files at 644, configure the web server not to execute PHP or scripts in those folders. Many hacked sites were compromised by a script uploaded disguised as an image and then executed.

    Common mistakes

    • Using 777 to make a problem disappear.
    • Ignoring ownership and changing modes repeatedly.
    • Giving the whole site write access instead of specific folders.
    • Allowing scripts to run inside upload folders.

    Related tools

    To keep server files out of a repository, use Gitignore Generator. To understand octal numbers, try Octal to Decimal Converter, and for conversions between bases, Number Base Converter.

    Small changes with symbolic modes

    When only one permission needs changing, symbolic notation is safer than retyping the full number. chmod g+w report.csv adds group write permission and leaves every other bit as it was, while chmod o-r config.php removes read access for everyone else. This avoids accidentally changing permissions you did not mean to touch.

    The plus sign in listings

    A plus sign after the permission string in ls -l output, such as rw-r--r--+, means the file also has access control list entries. These can grant access to specific users or groups beyond the ordinary mode bits, which explains cases where someone can read a file the mode seems to forbid. The getfacl command shows the full list.

    Backups and restores

    Restoring a site from a ZIP archive may not keep Unix permissions, depending on the tools used, while tar archives keep them when extracted with the right options. After any restore or migration, check permissions on a sample of files and folders, and reapply the standard settings if they look wrong.

    Privacy

    Calculations run in your browser. Nothing is sent to a server.

    Frequently asked questions

    What does chmod 755 mean?

    The owner can read, write and execute (7 = 4 + 2 + 1), while the group and others can read and execute (5 = 4 + 1). It is the usual mode for folders and scripts that everyone may use but only the owner may change.

    What does chmod 644 mean?

    The owner can read and write (6 = 4 + 2), and the group and others can only read (4). It is the standard mode for ordinary files such as web pages, images, stylesheets and documents.

    Why should I avoid chmod 777?

    777 lets every user on the system modify or replace the file. On a web server that means any compromised process or account could change your code. Use 755 for folders and 644 for files instead, and fix ownership rather than opening permissions.

    What permissions should SSH keys have?

    Private keys must be readable only by you, so use 600, or 400 for read-only. The .ssh folder itself should be 700. SSH refuses to use private keys with looser permissions and reports them as unprotected.

    What are setuid, setgid and the sticky bit?

    Setuid (4000) runs an executable with its owner's rights, setgid (2000) runs it with its group's rights or makes new files in a folder inherit the folder's group, and the sticky bit (1000) lets only a file's owner delete it in a shared folder.

    What does a capital S or T mean?

    It means the special bit is set but the matching execute permission is not, for example rwSr--r-- for setuid without owner execute. This is usually a mistake, because the special bit has no useful effect without execute.

    What does chmod -R do?

    It applies the mode recursively to a folder and everything inside it. Be careful, because files and folders usually need different modes; a common approach is find with -type d for folders and -type f for files.