Octal to Decimal

Encoders & Decoders

How to use the Octal to Decimal

Convert octal to decimal in two steps:

1

Enter the octal number

Type or paste any octal number using digits 0–7. The 0o or 0O prefix is optional and stripped automatically.

2

Read the decimal result

The decimal equivalent appears instantly. The panel below shows the same value in hexadecimal and binary.


When to use this tool

Use to convert octal values in Unix permissions and legacy system contexts:

  • Converting Unix file permission modes (e.g. chmod 755 or chmod 644) from octal to decimal to understand the permission bitmask
  • Reading octal escape sequences in C strings (e.g. \017, \377) as decimal to understand the character values
  • Interpreting octal values in legacy PDP/VAX assembly or Motorola 68000 documentation
  • Converting octal literals in Python 2/3 code (0o755) to decimal for comparison with decimal permission values
  • Reading octal output from system tools like ls -l, stat, or find when permissions are shown in octal format
  • Working with POSIX umask values (e.g. 022) to understand which permission bits they clear

Frequently asked questions

Q:How does octal to decimal conversion work?
Each octal digit represents a power of 8, starting from 8⁰ (= 1) at the rightmost position. Multiply each digit by its positional power of 8 and sum the results. For example, octal 17 = 1×8¹ + 7×8⁰ = 8 + 7 = 15. Octal 377 = 3×8² + 7×8¹ + 7×8⁰ = 192 + 56 + 7 = 255. Octal digits are always 0–7 — digits 8 and 9 are invalid in octal and the tool rejects them with a clear error message.
Q:Where does octal appear in modern computing?
Octal is most commonly seen in Unix/Linux file permissions. The chmod command uses octal to set read (4), write (2), and execute (1) permissions for owner, group, and others. chmod 755 means owner=7 (read+write+execute), group=5 (read+execute), others=5 (read+execute). Each octal digit represents 3 permission bits, which maps naturally to the 3-bit groupings of the 9-bit Unix permission field. Octal also appears in C string escape sequences (\007 = BEL, \012 = newline, \377 = 255).
Q:What is the 0o prefix in octal numbers?
The 0o prefix is the modern Python 3, JavaScript ES6, and C23 notation for octal literals. It means 'zero-o' (the letter o for octal), e.g. 0o755 = decimal 493. Before Python 3, Python used a leading zero (0755) for octal, which was changed because it was confusingly similar to decimal notation. In C (prior to C23) and older languages, a leading zero without 'o' indicates octal: 0755 in C is octal, not decimal.
Q:Why is octal a natural fit for Unix permissions?
Unix file permissions have 9 bits: 3 bits for owner (read, write, execute), 3 bits for group, and 3 bits for others. Since each octal digit represents exactly 3 bits (000 to 111 in binary = 0 to 7 in octal), three octal digits perfectly encode the full 9-bit permission field. For example, octal 755 = binary 111 101 101 — owner gets all three bits (rwx), group and others get read and execute (r-x). This 1:1 mapping is why permissions are traditionally shown and set in octal.
Q:What is the largest single-digit octal value and what does it equal in decimal?
The largest single octal digit is 7, which equals 7 in decimal (same value). Two octal digits range from 00 to 77, equal to decimal 0 to 63. Three octal digits range from 000 to 777, equal to decimal 0 to 511. The maximum 3-digit octal 777 = 7×64 + 7×8 + 7 = 448 + 56 + 7 = 511 = binary 111111111 (9 ones) = the maximum 9-bit permission value (all permissions granted to all users).
Q:How do I read a Unix chmod permission like 755 in decimal?
To understand 755 as a Unix permission: break it into three octal digits — 7, 5, 5. Each digit is owner, group, others permissions respectively. Convert each octal digit to binary: 7 = 111 (rwx), 5 = 101 (r-x), 5 = 101 (r-x). So 755 means owner=read+write+execute, group=read+execute, others=read+execute. In decimal, 755 octal = 493 decimal — but for permissions, the octal representation is more meaningful because each digit directly encodes one entity's three permission bits.