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.
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:
- Write each digit with its position:
7(3) 5(2) 2(1) 4(0) - Multiply by powers of 8:
7×8³ + 5×8² + 2×8¹ + 4×8⁰ - Calculate:
7×512 + 5×64 + 2×8 + 4×1 - 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 + execute5 = 101₂— group: read + execute5 = 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
0oprefix:0o755 - In JavaScript, strict mode requires
0o755 - The C library function
printfuses%oto 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
Related Topics
Convert Decimal to Octal
Decimal (Base 10) → Octal (Base 8)
Convert Binary to Octal
Binary (Base 2) → Octal (Base 8)
Convert Binary to Decimal
Binary (Base 2) → Decimal (Base 10)
Convert Hexadecimal to Decimal
Hexadecimal (Base 16) → Decimal (Base 10)
Convert Binary to Hexadecimal
Binary (Base 2) → Hexadecimal (Base 16)