Convert Unix file permissions between digits and letters

Convert chmod permissions between octal and letters, 755 to rwxr-xr-x and back, with setuid, setgid and sticky bits, and see what each class may do.

How to work out a chmod value

  1. 1

    Type a mode such as 755, rwxr-xr-x or u=rwx,g=rx,o=rx

  2. 2

    Press Read the permissions

  3. 3

    Copy the chmod command or the letters

Permissions read both ways, special bits included

Unix permissions say who may read, write and run a file. There are three classes, the file’s owner, its group and everyone else, and three permissions for each. chmod takes them as digits, ls -l shows them as letters, and this converts between the two.

Digits

Each class is one octal digit, the sum of read (4), write (2) and execute (1). So 7 is read, write and execute, 6 is read and write, 5 is read and execute, 4 is read only, and 0 is nothing. Three digits give owner, group and others in that order: 640 is owner read and write, group read, others nothing. A leading 0, as in 0644, changes nothing.

Letters

ls -l writes the same nine permissions as letters, r, w and x, with a hyphen for each one missing, after a first character for the file type (- for a file, d for a directory). This page accepts the nine letters with or without the type in front.

Special bits

A fourth digit in front holds three more bits. Setuid (4) makes a program run with its owner’s rights, setgid (2) runs it with its group’s rights or, on a directory, gives new files the directory’s group, and the sticky bit (1) on a directory lets only a file’s owner delete or rename it. In the letters, they take the execute place: s for setuid or setgid, t for sticky, in capitals when the execute bit underneath is off.

chmod clauses

chmod also takes symbolic clauses, such as u=rwx,g=rx,o=r, where u, g, o and a mean owner, group, others and all, and an equals sign sets, a plus sign adds and a minus sign removes. They are applied in order, starting from no permissions, to give the full mode.

The result gives the octal and letter forms, the chmod command, and what each class may do in words.

Nothing is uploaded. Modes are read in this tab.

Everything you need

Digits, letters or clauses

Type 755, rwxr-xr-x, an ls line such as -rw-r--r--, or a chmod clause such as u=rwx,g=rx,o=r.

Special bits shown

Setuid, setgid and sticky, with the capital S or T that warns of a missing execute bit.

Private by design

Modes are read in your browser and never sent anywhere.

Nothing uploaded: open the Network panel while it runs and check.

No daily limits or watermarks: free batches take up to 20 images.

Works offline: once the page has loaded, on any current browser.

Frequently asked questions

What does 755 mean?

The owner may read, write and run the file (7), and the group and everyone else may read and run it but not change it (5 and 5). As letters that is rwxr-xr-x. It is the usual mode for programs and for directories.

What is the difference between 644 and 755?

644, rw-r--r--, lets the owner read and write and everyone else only read, with nobody able to run it. It suits ordinary files such as web pages and documents. 755 adds permission to run, or for a directory, to enter it.

What do s, S, t and T mean in the letters?

They show the special bits in the execute place. s is setuid (owner) or setgid (group) with execute also set, t is the sticky bit with execute for others. A capital S or T means the special bit is set but execute is not.

What does a fourth digit, as in 4755, do?

It holds the special bits. 4 is setuid, 2 is setgid and 1 is sticky, added together. 4755 runs a program with its owner's rights, 2775 makes new files in a directory take its group, and 1777 suits a shared directory such as /tmp.

Sources

Related guides

Work with files privately and confidentlyPractical, sourced explanations for safer file conversion, sharing, and cleanup.