Number bases
What is a Number Base?
Every number system is built around a base - the number of distinct digit symbols it uses. The base also determines the positional value of each digit: as you move one place to the left, the value of that position is multiplied by the base. This is why the system is called positional notation - the value of a digit depends entirely on where it sits in the number.
In everyday life we use decimal (base 10), which has ten symbols: 0 through 9. The columns represent powers of ten (ones, tens, hundreds, and so on). Computer science introduces two further bases: binary (base 2) and hexadecimal (base 16). All three systems work on exactly the same positional principle - only the base, and therefore the number of symbols and the column values, changes.
The Three Number Bases
Decimal - Base 10
Decimal uses ten digit symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. When counting reaches 9, the ones column resets to 0 and the tens column increments by 1. Each column is worth ten times the column to its right. The number 347 means 3 hundreds + 4 tens + 7 ones.
| Hundreds (10²) | Tens (10¹) | Ones (10⁰) |
|---|---|---|
| 3 | 4 | 7 |
Decimal is the number system humans use naturally, most likely because we have ten fingers. It is not used internally by computers, but it is how we communicate numbers with people.
Binary - Base 2
Binary uses only two digit symbols: 0 and 1. Each column is worth twice the column to its right. The columns represent powers of two (1, 2, 4, 8, 16...). A binary digit is called a bit. The binary number 1011 means 1 eight + 0 fours + 1 two + 1 one, giving a decimal value of 11.
| Eights (2³) | Fours (2²) | Twos (2¹) | Ones (2⁰) |
|---|---|---|---|
| 1 | 0 | 1 | 1 |
Binary numbers grow in length quickly - representing large values requires many digits. This makes binary practical for electronics but awkward for humans to read and write directly.
Hexadecimal - Base 16
Hexadecimal (often shortened to hex) uses sixteen symbols. The digits 0-9 carry their usual values; the letters A, B, C, D, E, F represent the values 10 through 15 respectively. Each column is worth sixteen times the column to its right. The hex number 2F means 2 sixteens + 15 ones, giving a decimal value of 47.
| Symbol | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| Decimal value | 10 | 11 | 12 | 13 | 14 | 15 |
Hexadecimal can represent a wider range of values in fewer digits than binary. One hex digit is equivalent to exactly four binary digits, which makes it a compact and convenient notation when working with data.
Key Takeaways
- A number base defines how many distinct digit symbols a counting system uses. All systems use positional notation: the value of a digit depends on its position.
- Decimal (base 10) uses digits 0-9. Each column is ten times the column to its right.
- Binary (base 2) uses only 0 and 1. Each column is twice the column to its right. A single binary digit is a bit.
- Hexadecimal (base 16) uses digits 0-9 and letters A-F (where A=10, B=11... F=15). Each column is sixteen times the column to its right.
- All three systems operate on the same positional principle - only the base and the set of symbols differ.