Number Systems Explained: Binary, Hex, Octal & Decimal

Understanding binary, octal, decimal, and hexadecimal number systems and their uses in computing.

basicsmathcomputing

Number Systems in Computing

Computers fundamentally work with binary, but we use different number bases for different purposes.

Why Different Bases?

BaseNameDigitsUse Case
2Binary0-1How computers actually work
8Octal0-7Unix file permissions
10Decimal0-9Human-readable numbers
16Hexadecimal0-FMemory addresses, colors

Binary (Base 2)

The foundation of all computing. Each digit is a "bit".

Decimal 13 in binary:
13 = 8 + 4 + 0 + 1
= 1×2³ + 1×2² + 0×2¹ + 1×2⁰
= 1101₂

Hexadecimal (Base 16)

Each hex digit = 4 binary bits.

Binary:      1101 0101
Hexadecimal: D 5

Common uses:

  • Colors: #FF5733
  • Memory: 0x7FFE0000
  • MAC addresses: AA:BB:CC:DD:EE:FF

Octal (Base 8)

Each octal digit = 3 binary bits. Used in Unix permissions.

chmod 755 file
7 = rwx (owner)
5 = r-x (group)
5 = r-x (others)