Octal Number System Explained: Base-8 Basics

May 28, 20266 min read

What Is the Octal Number System?

The octal number system is a base-8 numeral system that uses eight digits: 0 through 7. Each position in an octal number represents a power of 8, just as each position in a decimal number represents a power of 10.

Octal emerged in computing because it provides a compact way to represent binary values. Every octal digit maps directly to exactly three binary digits (bits), making conversion between the two systems trivial.

How Octal Works

Place Values

In octal, the rightmost digit represents 8⁰ (1), the next represents 8¹ (8), then 8² (64), and so on:

Position43210
Power of 88⁴8⁰
Decimal value40965126481

The octal number 752 converts to decimal as:

7 × 64 + 5 × 8 + 2 × 1 = 448 + 40 + 2 = 490

Octal Prefix Convention

In many programming languages, octal numbers are written with a leading 0 or 0o:

LanguagePrefixExample
C, Java, Python 200755
Python 3, JavaScript, Rust0o0o755
Bash0 or nonechmod 755 implies octal

Python 3 dropped the bare 0 prefix because it caused confusion — 0123 looked decimal but was actually octal.

Converting Between Octal and Binary

This is where octal shines. Each octal digit maps to exactly three bits:

OctalBinaryOctalBinary
00004100
10015101
20106110
30117111

To convert octal to binary, replace each digit with its 3-bit equivalent:

Octal:  7   5   2
Binary: 111 101 010

To convert binary to octal, group bits from right to left in sets of three, then replace each group:

Binary: 1 101 011
Pad:    001 101 011
Octal:  1   5   3   → 153

This one-to-three mapping is why octal was popular on systems with word sizes divisible by 3 — like the 12-bit PDP-8 and the 36-bit IBM 700 series.

Converting Between Octal and Decimal

Octal to Decimal

Multiply each digit by its place value and sum:

752₈ = 7×64 + 5×8 + 2×1 = 490₁₀

Decimal to Octal

Repeatedly divide by 8 and collect remainders:

490 ÷ 8 = 61 remainder 2
 61 ÷ 8 =  7 remainder 5
  7 ÷ 8 =  0 remainder 7
Read remainders bottom-up: 752₈

Where Octal Is Used Today

Unix File Permissions

The most common modern use of octal is Unix file permissions. chmod 755 sets:

DigitBinaryMeaning
7111Read + Write + Execute
5101Read + Execute
5101Read + Execute

Each digit represents owner, group, and others respectively.

Embedded Systems

Some micro controllers use octal for memory addresses and register values, particularly 12-bit and 24-bit architectures where the bit grouping aligns naturally with octal digits.

Legacy Systems

Older IBM mainframes and PDP minicomputers used octal as their primary notation. Some documentation and debugging tools still display values in octal for backward compatibility.

Octal vs. Hexadecimal

PropertyOctalHexadecimal
Base816
Digits0–70–9, A–F
Bits per digit34
Word alignment12, 24, 36 bits8, 16, 32, 64 bits
Modern usageFile permissions, legacyMemory addresses, color codes

Hexadecimal dominates modern computing because modern word sizes (8, 16, 32, 64 bits) are multiples of 4, making hex the natural grouping. Octal persists in niches where its 3-bit grouping aligns better.

Key Takeaways

  • Octal is base-8, using digits 0 through 7
  • Each octal digit maps to exactly three binary bits, making octal-binary conversion trivial
  • The most common modern use is Unix file permissions (chmod 755)
  • Octal prefixes vary by language: 0 in older languages, 0o in modern ones
  • Hexadecimal has largely replaced octal because modern word sizes align with 4-bit grouping
  • Octal remains relevant on systems with word sizes divisible by 3

Try It Yourself

Convert between octal, decimal, binary, and hexadecimal instantly with our free Number Base Converter. Enter a value in any base and see all conversions at once.