Octal Numbers Explained: The Base-8 System for Unix Permissions

Octal (base-8) seems obscure until you encounter Unix file permissions. That chmod 755 command? Those are octal numbers encoding read, write, and execute permissions. Understanding octal unlocks efficient system administration and deepens your knowledge of number systems.

Our pktools.tech Octal Converter transforms octal values to decimal, binary, and hexadecimal instantly—essential for working with permissions, legacy systems, and low-level programming.

Convert Octal Numbers

Transform octal values to decimal, binary, and hex—perfect for Unix permissions and number system conversions.

Launch Octal Converter
Octal Converter showing Unix permission conversion

What Is Octal?

Octal is a base-8 numeral system using digits 0-7. Each digit represents three binary bits, making it a compact way to express binary values.

Octal digit:  0   1   2   3   4   5   6   7
Binary:      000 001 010 011 100 101 110 111

Octal to Decimal Conversion

Convert by multiplying each digit by its positional power of 8:

Octal 755 → Decimal

7 × 8² = 7 × 64 = 448
5 × 8¹ = 5 × 8  = 40
5 × 8⁰ = 5 × 1  = 5
                ----
Total:          493

Octal 755 = Decimal 493

Octal to Binary (Easy Method)

Each octal digit maps to exactly three binary bits. This direct mapping is why octal was popular before hexadecimal dominated:

Octal 755:
  7 = 111
  5 = 101
  5 = 101
  
Binary: 111101101

Unix File Permissions

This is where octal shines in everyday computing. Unix permissions use three bits per user category:

Permission Binary Octal
Read (r) 100 4
Write (w) 010 2
Execute (x) 001 1

Common Permission Combinations

Octal Symbolic Meaning
755 rwxr-xr-x Owner: full access; Others: read+execute
644 rw-r--r-- Owner: read+write; Others: read only
700 rwx------ Owner only: full access
777 rwxrwxrwx Everyone: full access (dangerous!)

Breaking Down chmod 755

chmod 755 file.sh

7 (owner):  4+2+1 = rwx (read + write + execute)
5 (group):  4+0+1 = r-x (read + execute)  
5 (others): 4+0+1 = r-x (read + execute)

How to Use the PKTools Octal Converter

  1. Enter an octal number (digits 0-7 only).
  2. View instant conversions: Decimal, binary, and hexadecimal.
  3. Copy the format you need.

The tool validates input—if you enter 8 or 9 (invalid octal digits), you'll get an error immediately.

Octal in Programming

C/C++/Java Octal Literals

int permissions = 0755;  // Leading zero = octal
// 0755 octal = 493 decimal

Warning: A common bug! 010 in C is NOT 10—it's octal 8.

Python Octal

# Python 3 uses 0o prefix
permissions = 0o755  # Explicit octal
print(oct(493))      # '0o755'

JavaScript Octal

// ES6+ uses 0o prefix
const perm = 0o755;  // 493
parseInt('755', 8);  // Parse string as octal → 493

Why Octal Existed Before Hex

Early computers used 6-bit, 12-bit, and 36-bit words. These divide evenly into groups of 3 bits (octal digits). When 8-bit bytes became standard, hexadecimal (groups of 4 bits) took over for most purposes.

Octal remains in Unix permissions because the rwx triplet maps perfectly to three bits—exactly one octal digit.

Conversion Reference Table

Octal Decimal Binary Hex
10 8 1000 8
100 64 1000000 40
644 420 110100100 1A4
755 493 111101101 1ED
777 511 111111111 1FF

Frequently Asked Questions

Why are Unix permissions in octal?
Each permission set (owner, group, others) has three bits (rwx). Three bits = one octal digit. It's a perfect match.

What's the highest single-digit octal number?
7 (which equals decimal 7 and binary 111).

Why does my code use 0o prefix vs leading zero?
Leading zeros (0755) caused bugs when users wrote 010 expecting decimal 10. Python 3 and ES6 adopted 0o prefix for clarity.

How do I convert decimal to octal manually?
Divide repeatedly by 8, recording remainders. Read remainders bottom-to-top.

The Bottom Line

Octal may seem archaic, but it's essential for Unix/Linux permissions. Understanding how chmod 755 maps to rwxr-xr-x makes you a more effective system administrator and programmer.

Our pktools.tech Octal Converter handles all octal conversions instantly. Paste a permission value and understand exactly what access it grants.