Home / Learn / What Is Octal?

What Is Octal?

Octal is base 8 — the quiet middle child of number systems. It lost the popularity contest to hexadecimal, but it still runs one of the most-used commands in computing: chmod.

Eight digits, no 8 or 9

Octal is the base-8 positional number system, using the digits 0–7. There is no digit "8" — the value eight is written 10 in octal (one eight, zero ones), exactly as ten is written 10 in decimal. Place values are powers of eight: 1, 8, 64, 512…

To read 55 in octal: 5 × 8 + 5 × 1 = 40 + 5 = 45 in decimal. And 100 in octal is 1 × 64 = 64 — a useful reminder that "100" means "one of the base squared" in every system.

Three bits per digit

Octal's neat trick mirrors hex's: since 8 = 2³, one octal digit = exactly three bits. Converting between octal and binary is pure substitution:

OctalBinaryOctalBinary
00004100
10015101
20106110
30117111

So octal 755 becomes binary 111 101 101 — just expand each digit. In the 1960s and 70s this made octal the natural shorthand for machines with 12-bit, 24-bit and 36-bit word sizes (all divisible by 3). When 8-bit bytes took over, hexadecimal — with its 4-bit digits dividing 8 evenly — won instead.

Where octal survived: file permissions

Octal's greatest legacy is the Unix chmod command. Every file has three permission groups — owner, group, others — and each group has three yes/no flags: read, write, execute. Three flags = three bits = one octal digit:

DigitBinaryRead (4)Write (2)Execute (1)
7111✓✓✓
6110✓✓–
5101✓–✓
4100✓––

So chmod 755 script.sh means: owner gets 7 (read + write + execute), group and others get 5 (read + execute). The digit is literally the sum of the permission values: read=4, write=2, execute=1. Want a private file only you can read and write? That's 600. This elegant mapping is why octal, and not hex, owns this particular corner of computing.

A related octal cameo: in C, Java and Python 2, a numeric literal with a leading zero is octal — 010 means eight, not ten. This has caused real bugs (is 09 even valid? No — 9 isn't an octal digit), which is why Python 3 requires the explicit 0o10 prefix instead. If you ever see a "leading zero" bug in old code, octal is usually the culprit.

Octal today

Outside permissions, octal is mostly a historical curiosity — you'll spot it in some embedded systems, legacy mainframe documentation, and the occasional programming language where a leading 0 marks an octal literal (a notorious source of bugs: in C, 010 is eight, not ten). For general binary shorthand, hexadecimal won decisively. Still, understanding octal completes the picture: it's the cleanest demonstration that any base that's a power of two converts to binary by simple digit substitution.

Try it yourself

Convert octal values to decimal and binary, or explore any base from 2 to 36.

Key takeaways

Frequently asked questions

What do octal file permissions like 755 mean?

Each digit is three permission bits: read (4), write (2), execute (1). 755 means owner gets 7 (4+2+1: read, write, execute) while group and others get 5 (4+1: read and execute).

Why are there no 8s or 9s in octal?

Octal is base 8, so it only has eight digits: 0–7. The value eight is written as 10 in octal (one eight and zero ones), just as ten is written 10 in decimal.

Where is octal still used today?

Mainly Unix/Linux file permissions (chmod 755), some embedded systems, and legacy contexts. Hexadecimal has replaced it almost everywhere else as the binary shorthand.

How do I convert octal to binary?

Replace each octal digit with its 3-bit binary equivalent: 0→000, 1→001, 2→010, 3→011, 4→100, 5→101, 6→110, 7→111. So 55 in octal becomes 101 101 in binary.