Skip to main content

    Chmod Calculator

    Calculate Unix/Linux file permissions. Toggle read, write, execute for owner, group, and others.

    Free to use. Runs in your browser.

    Set file permissions by toggling checkboxes or entering an octal number like 755.

    Octal

    755

    Symbolic

    -rwxr-xr-x

    Command

    chmod 755 filename

    Unix File Permissions: How They Work

    Every file and directory on a Unix/Linux system has three sets of permissions: one for the owner, one for the group, and one for everyone else. Each set controls three actions: read (r), write (w), and execute (x). That's 9 permission bits total, which is why chmod uses 3-digit octal numbers, each digit encodes one set.

    The number system is elegant: read = 4, write = 2, execute = 1. Add them up for each group. So 7 (4+2+1) means full access, 5 (4+1) means read and execute, 6 (4+2) means read and write. chmod 755 gives the owner full access and everyone else read/execute, the most common permission for web directories and scripts.

    Getting permissions wrong causes two kinds of problems: too restrictive (users can't access what they need) or too permissive (security vulnerability). This calculator helps you find the exact permission set for your use case.

    Common Permission Patterns

    OctalSymbolicUse Case
    644-rw-r--r--Standard files (HTML, CSS, images, configs)
    755-rwxr-xr-xDirectories, executable scripts, web root folders
    600-rw-------SSH keys, .env files, private credentials
    700-rwx------Private scripts, .ssh directory
    775-rwxrwxr-xShared group directories, deployment folders
    444-r--r--r--Read-only files, system configs you don't want modified
    777-rwxrwxrwxAVOID, full access for everyone (security risk)

    What this means for you: 99% of the time you need either 644 (files) or 755 (directories/scripts). If you're reaching for 777, stop, there's almost always a better solution involving group permissions or ACLs.

    Permission Mistakes That Cause Real Problems

    SSH key too permissive

    SSH refuses to use keys with permissions other than 600 or 400. "Permissions 0644 for 'id_rsa' are too open" is one of the most common SSH errors. Fix: chmod 600 ~/.ssh/id_rsa

    Web server 403 errors

    Nginx/Apache return 403 Forbidden when they can't read files. Usually the web server user needs read access (644 for files, 755 for directories). Check both the file AND every parent directory in the path.

    Script won't execute

    "Permission denied" when running a script usually means it lacks the execute bit. Fix: chmod +x script.sh (adds execute for everyone) or chmod 755 script.sh (explicit full permission set).

    chmod 777 on production

    Giving everyone write access to web files means any compromised process can modify your site. This is how many web defacement attacks succeed. Use proper group permissions instead of 777.

    Permission Number Quick Reference

    NumberPermissionBinary
    0No access000
    1Execute only001
    2Write only010
    3Write + execute011
    4Read only100
    5Read + execute101
    6Read + write110
    7Read + write + execute111

    Each digit in a chmod number (e.g., 755) maps to one of these values. The first digit is the owner, second is the group, third is everyone else. So 755 = owner gets 7 (rwx), group gets 5 (r-x), others get 5 (r-x).

    Related Tools

    How to use this tool

    1

    Toggle read, write, execute checkboxes for owner, group, and others

    2

    Or enter a 3-digit octal number and click Apply

    3

    Copy the chmod command to use in your terminal

    Common uses

    • Setting correct permissions for web server files
    • Fixing SSH key permission errors
    • Configuring deployment script permissions
    • Understanding and debugging Unix permission issues

    Share this tool

    Frequently Asked Questions

    What is chmod?
    chmod (change mode) is a Unix/Linux command that sets file or directory permissions for the owner, group, and others.
    What do the numbers mean?
    Each digit represents a permission set: 4 = read, 2 = write, 1 = execute. They're added together, e.g. 7 = read + write + execute.
    What is a common chmod value?
    755 is common for directories and scripts (owner: rwx, group/others: r-x). 644 is common for files (owner: rw-, group/others: r--).
    What does chmod 777 mean?
    chmod 777 grants read, write, and execute permissions to everyone. It's generally insecure and should be avoided in production.
    What's the difference between chmod 644 and 755?
    644 is for files: the owner can read and write; everyone else can only read. 755 is for files or directories: the owner can read, write, and execute; everyone else can read and execute. Use 644 for HTML, CSS, and config files; use 755 for scripts and directories.
    How do I apply chmod recursively to a directory?
    Use the -R flag: chmod -R 755 my-folder/. This applies the permission to the folder and every file and subfolder inside it. Be careful, recursive chmod can unintentionally make files executable or remove needed permissions on system folders.
    What are special permission bits (setuid, setgid, sticky)?
    The leading 4 (setuid), 2 (setgid), or 1 (sticky) digit adds special behaviour. Setuid makes an executable run with the owner's privileges, common on binaries like passwd. Setgid on directories makes new files inherit the directory's group. The sticky bit on shared directories like /tmp stops users deleting each other's files.

    Results are for general informational purposes only and should be checked before use. They are not professional advice. See our Disclaimer and Terms of Service.