Number Bases
Every number you have ever written is a coded message, and the code depends on a single hidden choice: the base. When you write "204," you are not writing two-hundred-and-four as a single symbol — you are giving instructions that say "two hundreds, no tens, four ones." Change the base, and the same digits mean something entirely different. Understanding number bases means understanding the machinery of counting itself, and it is the key that unlocks how computers, network addresses, colors on your screen, and even ancient astronomy all work.
This is one of those topics where a small idea — that the position of a digit carries weight — turns out to be one of the most powerful inventions in human history. Once you truly grasp place value, binary and hexadecimal stop being mysterious and become obvious.
Learning Objectives
- Explain what a number base is and how positional (place-value) notation works.
- Read and write numbers in binary (base 2), octal (base 8), and hexadecimal (base 16).
- Convert whole numbers from any base to base 10 and back.
- Convert directly between binary, octal, and hexadecimal using digit-grouping shortcuts.
- Explain clearly why computers use binary and where hexadecimal is used in practice.
- Trace the historical development of place-value systems from Babylon to Leibniz.
Quick Answer
A number base (or radix) is the number of distinct digits a system uses and the multiplier between adjacent columns. In base 10 (decimal), we use ten digits (–) and each column is worth ten times the one to its right. Binary (base 2) uses only and ; octal (base 8) uses –; hexadecimal (base 16) uses – then A–F for ten through fifteen. To convert to base 10, multiply each digit by its place value (a power of the base) and add. To convert from base 10, repeatedly divide by the base and read the remainders bottom-up. Computers use binary because electronic switches are naturally two-state (on/off), and hexadecimal is a compact human-friendly shorthand for binary.
Where It Came From
For most of history, humans counted without place value, and it made arithmetic agonizing. Roman numerals, for instance, have no zero and no columns — MCMXLVII (1947) cannot be added by lining up digits. Every calculation needed a counting board or an abacus because the notation itself did no work.
The first great breakthrough came from Babylon around 2000–1800 BCE. Babylonian mathematicians developed a positional system in base 60 (sexagesimal). Why 60? It was a practical compromise. Sixty is divisible by 2, 3, 4, 5, 6, 10, 12, 15, 20, and 30, which makes fractions like a third or a quarter come out cleanly — a huge convenience for merchants and astronomers dividing quantities. The Babylonians tracked the motions of the stars with this system, and its fingerprints are still on your wristwatch: 60 seconds in a minute, 60 minutes in an hour, and 360 degrees in a circle are all direct inheritances from Babylonian base-60.
The Babylonians, however, had no true zero for centuries — an empty column was ambiguous, a genuine problem. The decimal place-value system with a real zero was perfected in India by roughly the 6th–7th century CE, associated with mathematicians such as Brahmagupta, who gave explicit rules for computing with zero. This system traveled through the Islamic world — the scholar al-Khwarizmi (9th century, whose name gives us "algorithm") wrote influential texts on it — and reached Europe through Fibonacci's Liber Abaci (1202).
The final chapter belongs to Gottfried Wilhelm Leibniz, who around 1679–1703 worked out binary arithmetic — counting with only and . Leibniz was fascinated that all numbers could be built from two symbols, and he saw philosophical beauty in it (he linked and to "nothing" and "God"). He could not have known that two and a half centuries later, binary would become the literal language of every computer on Earth, because a switch that is either off () or on () is the simplest, most reliable thing electronics can build.
Place Value: The Engine Behind Every Base
The heart of every base system is positional notation: the value of a digit depends on its position, and each position is a power of the base . For a base , the columns from right to left are worth:
In base 10, that means the ones, tens, hundreds, thousands columns. The number literally means:
A base needs exactly distinct digits, from up to . That is why base 2 needs only and , and why base 16 needs extra symbols (A–F) once the single digits run out. The general rule for a number with digits in base is:
Worked example. Interpret in three different bases.
- Base 10: .
- Base 2: (in decimal).
- Base 8: (in decimal).
Same four symbols, three completely different quantities. That is the whole idea in one line.
Binary, Octal, and Hexadecimal
These three bases dominate computing, so it is worth meeting each one.
Binary (base 2) uses only and . Each column doubles: A single binary digit is called a bit. Eight bits form a byte, which can represent different values ( to ).
Worked example — binary to decimal. Convert .
So .
Octal (base 8) uses digits –, with columns Octal was popular in early computing and still appears in Unix file permissions (e.g. chmod 755).
Worked example — octal to decimal. Convert .
So .
Hexadecimal (base 16) uses – then A, B, C, D, E, F for ten through fifteen. Columns are Hex is everywhere in computing: memory addresses, color codes like #FF8800, and byte dumps.
Worked example — hex to decimal. Convert . Here A and F .
So .
Here is a quick reference showing how the same values look across bases:
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 5 | 0101 | 5 | 5 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
Converting From Decimal: The Division-Remainder Method
To convert a decimal number into another base, repeatedly divide by the base and collect the remainders. The remainders, read from last to first (bottom to top), give the answer.
Worked example — decimal to binary. Convert to binary.
- remainder
- remainder
- remainder
- remainder
- remainder
- remainder
Reading the remainders bottom-up: . Check: . Correct, so .
Worked example — decimal to hexadecimal. Convert to hex.
- remainder (which is C)
- remainder (which is B)
- remainder
Reading bottom-up: . Check: . Correct.
The Binary–Octal–Hex Shortcut
Because and , you can convert between binary and octal/hex by simply grouping bits — no arithmetic through decimal needed. This is why hex is so beloved: it is just binary in compact clothing.
Binary to hex: group the bits into fours from the right; each group becomes one hex digit.
Worked example. Convert to hex. Group as 1101 0110. Now and . So the answer is .
Binary to octal: group into threes from the right.
Worked example. Convert to octal. Group as 11 010 110, i.e. 011 010 110. Then , , , giving . Check via decimal: , and . Correct.
Real-World Applications
- Computer hardware and memory. Every value inside a computer is stored in binary. Memory addresses and machine instructions are read and debugged in hexadecimal because it maps cleanly to bytes.
- Web and graphic design. Colors are written as hex codes:
#RRGGBB. For example#FF0000is pure red because FF () is the maximum for the red channel. - Networking. IPv6 addresses are written in hexadecimal, and subnet masks are best understood in binary. MAC addresses are hex too.
- File permissions. Unix/Linux permissions use octal —
chmod 644sets read-write for the owner and read-only for others, where each octal digit encodes three permission bits. - Timekeeping and angles. The Babylonian base-60 legacy survives in 60-second minutes, 60-minute hours, and the 360-degree circle.
- QR codes and error correction. Data encoding schemes rely on base conversions and binary polynomial arithmetic.
Common Mistakes
Mistake 1: Reading division remainders top-to-bottom. When converting from decimal, students often write the remainders in the order they computed them. Why it's wrong: the first remainder is the least significant (rightmost) digit, not the leftmost. Correction: always read the remainders bottom-up — the last remainder you compute is the leading digit.
Mistake 2: Confusing the number of digits with the base value. People think base 2 "goes up to 2" or base 16 "goes up to 16." Why it's wrong: a base- system has digits through ; the digit never appears alone. Correction: base 2 uses only and ; base 16 uses – and A–F (which is ), and itself is written .
Mistake 3: Grouping bits from the left. When using the binary-to-hex shortcut, students group the leftmost bits first. Why it's wrong: place value is anchored on the right, so incomplete groups must be on the left (pad with leading zeros). Correction: always group into fours (hex) or threes (octal) starting from the right, padding the leftmost group with zeros if needed.
Comparison and Connections
The four common bases differ only in their radix, but each is suited to a purpose:
| Base | Name | Digits | Main use |
|---|---|---|---|
| 2 | Binary | 0, 1 | Internal computer storage/logic |
| 8 | Octal | 0–7 | Unix permissions, legacy systems |
| 10 | Decimal | 0–9 | Everyday human arithmetic |
| 16 | Hexadecimal | 0–9, A–F | Compact display of binary data |
The deep connection is that octal and hexadecimal are just binary compressed — because 8 and 16 are powers of 2, three or four bits collapse into a single digit. Decimal, by contrast, is not a power of 2, which is exactly why converting between decimal and binary requires real division rather than simple grouping. This same place-value idea extends to non-integer bases and even to positional systems for fractions (using negative powers of the base after a "radix point").
Practice Questions
Recall
What digits are used in hexadecimal, and what decimal values do the letters A through F represent?
Answer: Hexadecimal uses – and A, B, C, D, E, F, representing respectively.
Understanding
Explain why means a different quantity in every base, and give its decimal value in base 2, base 8, and base 16.
Answer: "" always means "one lot of the base plus zero." So , , and in decimal. The symbols are identical; the base sets the value of the leading column.
Application
Convert to both binary and hexadecimal.
Answer: Binary: . Hex: r (C), then r , giving . Check: .
Analysis
Without converting through decimal, convert to binary, then to octal. Explain why the two shortcuts can be chained.
Answer: Each hex digit becomes 4 bits: , F , , so . Regroup into threes from the right: 111 110 100 . Chaining works because binary is the common "atomic" layer — both hex (4-bit groups) and octal (3-bit groups) are built directly on powers of 2.
FAQ
Why do computers use binary instead of decimal? Electronic components are most reliable when they only have to distinguish two states — on and off, high and low voltage. Two states are easy to build, easy to keep distinct despite noise, and map perfectly onto the logic values true/false. Building reliable ten-state circuits would be far harder and more error-prone, so binary won.
If binary is what computers use, why is hexadecimal everywhere? Long binary strings are hard for humans to read and easy to miscount — 11010110 versus D6. Since one hex digit equals exactly four bits, hex gives a compact, error-resistant way to write and read the same binary data. It is for human convenience, not the machine's.
Is there a "best" or most natural base? No base is mathematically more "correct." Base 10 is popular only because we have ten fingers. Some argue base 12 is more practical (it divides evenly by 2, 3, 4, and 6), and base 60 gave the Babylonians rich divisibility. The right base depends on the job.
How do I convert fractions to another base? Use columns of negative powers after a radix point (). To convert a decimal fraction to binary, repeatedly multiply by 2 and record the integer parts top-down (the mirror image of the division method for whole numbers).
What is the difference between a bit and a byte? A bit is a single binary digit ( or ). A byte is a group of 8 bits, able to represent distinct values. Bytes are the standard unit for measuring memory and file sizes.
Quick Revision
- Base : uses digits to ; column values are powers of :
- To decimal: multiply each digit by its place value and sum: .
- From decimal: divide repeatedly by ; read remainders bottom-up.
- Binary hex: group bits in fours from the right.
- Binary octal: group bits in threes from the right.
- Key equalities: , ; 1 byte bits values.
- Hex letters: A, B, C, D, E, F.
- History: Babylon (base 60) → India (decimal + zero) → Leibniz (binary, ~1700).
Related Topics
Prerequisites
- Number Theory overview — foundational ideas about integers and their structure.
Related Topics
- Divisibility and factors — understanding why base 60 and base 12 are convenient.
- Modular arithmetic — closely tied to remainders, the engine of base conversion.
Next Topics
- Binary arithmetic and two's complement — how computers actually add and store negative numbers.
- Prime numbers and factorization — deeper number-theoretic structure built on integers.