Convert Octal to Decimal

Convert octal (base 8) numbers to decimal with step-by-step examples. Learn about octal's role in Unix file permissions and legacy computing systems today.

Octal (Base 8)Decimal (Base 10)Conversion

Detailed Explanation

Octal (base 8) uses digits 0 through 7. While less common than hex in modern computing, octal remains important for Unix/Linux file permissions and appears in some legacy systems and programming contexts.

Step-by-step example — converting 7524 (octal) to decimal:

  1. Write each digit with its position: 7(3) 5(2) 2(1) 4(0)
  2. Multiply by powers of 8: 7×8³ + 5×8² + 2×8¹ + 4×8⁰
  3. Calculate: 7×512 + 5×64 + 2×8 + 4×1
  4. Sum: 3584 + 320 + 16 + 4 = 3924

So 7524₈ = 3924₁₀.

Octal in Unix file permissions:

The most common place you will encounter octal today is in Unix/Linux file permissions. The command chmod 755 file uses octal notation:

  • 7 = 111₂ — owner: read + write + execute
  • 5 = 101₂ — group: read + execute
  • 5 = 101₂ — others: read + execute

Each octal digit maps to exactly 3 binary bits, which perfectly represents the three permission bits (rwx) for each user class.

Octal in programming languages:

  • In C and C++, octal literals start with a leading zero: 0755
  • In Python 3, octal uses the 0o prefix: 0o755
  • In JavaScript, strict mode requires 0o755
  • The C library function printf uses %o to format numbers in octal

Historical context:

Octal was more popular in early computing when machines used word sizes that were multiples of 3 bits (like the PDP-8 with 12-bit words). Each octal digit represented 3 bits cleanly. As 8-bit bytes and 16/32/64-bit words became standard, hex (4 bits per digit) largely replaced octal for general use. However, octal persists in file permissions and some telecommunications protocols.

Use Case

Linux system administrators interpret octal file permission values like 0644 or 0755 to understand and configure access control for files and directories.

Try It — Number Base Converter

Open full tool