Binary to Octal Converter

Convert binary to octal and octal to binary. Step-by-step 3-bit grouping, Unix file permissions decoder, common chmod values, and complete reference table.

Binary (3-bit groups)
111 101 101
9 bits
Octal
0o755
3 digit(s)
Decimal
493
493
Hexadecimal
0x1ED
4-bit grouping
Binary (4-bit groups)
0001 1110 1101
Hex-aligned grouping
Unix Permissions
rwxr-xr-x
Owner: rwx | Group: r-x | Other: r-x

Step-by-Step Conversion

111
โ†•
7
101
โ†•
5
101
โ†•
5
= 111 101 101

Unix File Permissions (Octal)

OctalBinaryPermissionMeaning
0000---None
1001--xExecute
2010-w-Write
3011-wxWrite Execute
4100r--Read
5101r-xRead Execute
6110rw-Read Write
7111rwxRead Write Execute

Common Permission Sets

OctalSymbolicDescription
777rwxrwxrwxFull access for everyone (dangerous)
755rwxr-xr-xOwner full, others read/execute (common for dirs)
750rwxr-x---Owner full, group read/execute, others none
700rwx------Owner only (private directories)
666rw-rw-rw-Read/write for everyone (rarely used)
644rw-r--r--Owner read/write, others read only (common for files)
600rw-------Owner read/write only (private files)
400r--------Owner read only (SSH keys)
Planning notes, formulas, and examples

About the Binary to Octal Converter

Octal (base 8) uses digits 0-7, with each digit mapping to exactly 3 binary bits. This makes binary-to-octal conversion as straightforward as grouping bits in threes โ€” similar to how hexadecimal groups bits in fours. Octal's most prominent modern use is in Unix/Linux file permissions, where chmod commands like 755, 644, and 777 control read, write, and execute access.

It gives bidirectional conversion between binary and octal, along with step-by-step visualization showing how each 3-bit group maps to its octal digit. For Unix users, the built-in permissions decoder translates any 3-digit octal value into its symbolic permission string (rwxr-xr-x) and explains what each digit means for owner, group, and other users.

Whether you are a Linux system administrator setting file permissions, a CS student learning number bases, or a programmer working with legacy systems that use octal notation, this converter handles the conversion while teaching the underlying mapping. The common permissions reference table covers the most frequently used chmod values with explanations.

When This Page Helps

The octal-binary mapping (3 bits per digit) is simpler than hex, but the real value of this converter is the Unix permissions integration. Enter a chmod value like 755 and see the binary breakdown, symbolic notation, and what each permission level means โ€” no need to memorize the permission table.

How to Use the Inputs

  1. Select Binary โ†’ Octal or Octal โ†’ Binary.
  2. Enter the binary or octal value.
  3. View converted values in all bases, plus Unix permission interpretation for valid chmod values.
  4. Follow the Step-by-Step Conversion to see 3-bit group mapping.
  5. Check the Unix File Permissions table for the octal-to-permission mapping.
  6. Refer to Common Permission Sets for frequently used chmod values.
Formula used
Binary to Octal: Group binary digits in groups of 3 from right, convert each group (000=0, 111=7). Octal to Binary: Replace each octal digit with its 3-bit binary equivalent. Unix: Each octal digit = r(4) + w(2) + x(1). E.g., 7 = rwx, 5 = r-x, 4 = r--

Example Calculation

Result: 111 101 101 (binary) = rwxr-xr-x

755 in octal: 7=111 (rwx for owner), 5=101 (r-x for group), 5=101 (r-x for others). This is the standard permission for executable files and directories in Unix/Linux.

Tips & Best Practices

  • Key octal-binary pairs: 0=000, 1=001, 2=010, 3=011, 4=100, 5=101, 6=110, 7=111.
  • For Unix permissions: r=4, w=2, x=1. Add them: rwx=7, rw-=6, r-x=5, r--=4, ---=0.
  • Most common permissions: 755 for directories/executables, 644 for regular files, 600 for private files.
  • The leading digit in 4-digit chmod (e.g., 1755) sets special bits: setuid(4), setgid(2), sticky(1).
  • C programming uses 0 prefix for octal literals: 0777 is octal 777. Avoid accidental octal: 010 = 8, not 10.
  • Python uses 0o prefix: 0o755. JavaScript also recognizes 0o prefix in strict mode.

Octal in Computing History

Octal was widely used in early computing when word sizes were multiples of 3 (6-bit, 12-bit, 36-bit). The PDP-8, one of the most popular minicomputers, used 12-bit words displayed as 4 octal digits. When 8-bit bytes and 16/32-bit words became standard, hexadecimal (which groups 4 bits) became more practical, but octal persists in Unix permissions.

Understanding Unix Permission Bits

Unix file permissions use 9 bits: 3 for owner, 3 for group, 3 for others. Each group has read (r=4), write (w=2), and execute (x=1) bits. The octal representation compresses each 3-bit group into a single digit. Special bits (setuid, setgid, sticky) use a fourth leading digit.

Security Implications of File Permissions

Incorrect permissions are a common security vulnerability. SSH private keys must be 600 or 400. Web-accessible directories should never be 777. The principle of least privilege says: grant the minimum permissions needed. Use `chmod -R` carefully โ€” recursive permission changes can expose sensitive files.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Group binary digits in groups of 3 from right to left, padding with zeros if needed. Convert each group: 000=0, 001=1, 010=2, 011=3, 100=4, 101=5, 110=6, 111=7.