Skip to content
UtiliaTools

What Is a Number Base? Understanding Binary, Octal, Decimal, and Hexadecimal

Number bases are fundamental systems for representing values. From the binary code that powers computers to the hexadecimal system used in programming, understanding number bases is key to computer science.

What Is a Number Base?

A number base (or radix) defines how many unique digits a numeral system uses to represent values. The base determines the place value of each digit position — each position represents a power of the base. While we use base-10 (decimal) in everyday life, computers and programmers rely on other bases that are better suited to digital systems.

The Decimal System (Base 10)

The decimal system is the most familiar number system. It uses ten digits (0–9) and each position represents a power of 10:

  • The number 345 means: 3 × 10² + 4 × 10¹ + 5 × 10⁰
  • That is: 300 + 40 + 5 = 345

We use base 10 because humans have ten fingers, which historically made it a natural counting system.

The Binary System (Base 2)

Binary is the foundation of all digital computing. It uses only two digits: 0 and 1. Each position represents a power of 2:

  • The binary number 1011 means: 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰
  • That is: 8 + 0 + 2 + 1 = 11 in decimal

Computers use binary because electronic circuits have two states: on (1) and off (0). Every piece of data in a computer — text, images, sound — is ultimately stored as sequences of binary digits (bits).

The Octal System (Base 8)

Octal uses eight digits (0–7). Each position represents a power of 8. It was historically popular in early computing systems because each octal digit maps neatly to three binary digits:

  • The octal number 17 means: 1 × 8¹ + 7 × 8⁰ = 8 + 7 = 15 in decimal
  • Octal 17 = binary 001 111

Octal is less common today but still appears in Unix file permissions (e.g., chmod 755).

The Hexadecimal System (Base 16)

Hexadecimal uses sixteen symbols: digits 0–9 and letters A–F (representing values 10–15). Each hex digit maps to exactly four binary digits (one nibble), making it a compact way to represent binary data:

  • The hex number FF means: 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255 in decimal
  • Hex FF = binary 1111 1111

Hexadecimal is widely used in programming for memory addresses, color codes, and representing binary data in a human-readable form.

Converting Between Bases

Converting between number bases involves mathematical operations. To convert from decimal to another base, repeatedly divide by the target base and record remainders. To convert from another base to decimal, multiply each digit by its positional value and sum the results. Understanding these conversions is fundamental for computer science, networking, and digital electronics.

Frequently asked questions

Why do computers use binary?

Computers use binary because electronic circuits operate in two states — on (1) and off (0). Binary is the simplest and most reliable way to represent data electronically.

How do I convert decimal to binary?

Divide the decimal number by 2 repeatedly, recording the remainder each time. Read the remainders from bottom to top to get the binary representation.

What is hexadecimal used for?

Hexadecimal is used in programming for memory addresses, color codes (like #FF0000 for red), and as a compact, human-readable representation of binary data.

Related guides

Try the tool

Use our free tool to get started instantly.

Number Base Converter →

Last updated on 2026-09-27