Convert Unix File Permissions: Octal to Binary Chmod Values

100% Private Report Issue

Step-by-Step Workflow

01

Paste chmod octal value (755, 644, etc)

02

Tool converts to 9-bit binary automatically

03

Map binary to rwx permission pattern

Specifications

Primary conversion
Octal → Binary
Common use
Unix file permissions (chmod)
Input format
3-digit octal (755, 644, 777)
Output format
9-bit binary (rwxr-xr-x pattern)

The Challenge

chmod 755 is memorized muscle memory but what permissions does it grant? Octal→binary conversion (755 → 111 101 101 → rwxr-xr-x) reveals owner=read+write+execute, group=read+execute, other=read+execute. Misunderstanding permissions creates security holes or breaks application access. Worse: unusual permissions like 640 or 2755 (setgid) require mental binary conversion to understand. Wrong permissions cause production incidents—web server can't read files (644 needed), scripts won't execute (755 needed), or world-writable security risks (777 avoided).

Best Practices

  • Each octal digit converts to 3 binary bits: 7→111 (rwx), 5→101 (r-x), 4→100 (r--), 0→000 (---)
  • Permission order: owner|group|other. 755 = 111|101|101 = rwx|r-x|r-x
  • Common patterns: 644 (rw-r--r--) for files, 755 (rwxr-xr-x) for executables, 600 (rw-------) for secrets
  • Setuid/setgid: 4-digit octal like 2755 has special bit. 2→setgid (inherit group), 4→setuid (run as owner)
  • Security: never 777 (rwxrwxrwx) in production—world-writable creates vulnerabilities. Use 755 max for directories
  • Web servers need 644 for files (read-only by apache/nginx), 755 for directories (traverse + read)
  • SSH keys require 600 (owner read/write only)—SSH refuses to use keys with group/other permissions

Frequently Asked Questions

What do the three chmod digits mean?

First digit = owner permissions, second = group, third = other (everyone else). Each digit is octal sum: read=4, write=2, execute=1. 755 means owner=7 (4+2+1=rwx), group=5 (4+1=r-x), other=5 (4+1=r-x). Binary shows bit patterns: 111 101 101.

Why use octal instead of binary for permissions?

Convenience. 3 octal digits (755) shorter than 9 binary bits (111101101). Each octal digit maps directly to 3 bits, grouping permissions naturally. Historical Unix design—octal was compact for punch cards. Binary conversion helps understand bits but octal stays standard for chmod commands.

What are setuid and setgid permissions?

4-digit chmod values (2755, 4755). First digit adds special bits: 4=setuid (execute as file owner), 2=setgid (execute as file group). Binary shows in high 3 bits. Used for sudo, passwd, cron—programs needing elevated privileges. Security risk if misused—audit carefully.

How do I fix 'permission denied' errors?

Check file permissions with ls -l. Compare to required access: scripts need execute bit (x), web files need read (r), config files need write (w). Change with chmod: 755 for executables, 644 for data files, 600 for secrets. Verify owner/group with chown if needed.