Number Systems
Binary, denary and hexadecimal. How to convert between all three, why each base exists, and where you encounter them in the real world.
Why do computers use binary?
Before you touch a single conversion, answer this first: what is actually inside a computer?
Billions of microscopic transistors, each acting as a switch. A switch has two states: on or off. Not on-a-bit or on-mostly or on-sometimes. Just on or off. Two states. That is it.
Binary has exactly two digits: 0 and 1. A 0 maps to a switch that is off. A 1 maps to a switch that is on. This is why computers use binary -- not because someone chose it arbitrarily, but because the physical hardware that computers are made of can only be in two states.
Every number, letter, image, sound and instruction in a computer is stored as a sequence of 1s and 0s. The rest of this series explores exactly how that works.
Binary and denary
Denary (base 10) is the number system you use every day. It has ten digits: 0 through 9. The position of each digit tells you its value -- units, tens, hundreds, thousands.
Binary (base 2) uses only two digits. The positions work the same way, but instead of powers of 10, you use powers of 2.
| Bit position | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Power of 2 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
| Example: 10100101 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
| Contribution | 128 | 0 | 32 | 0 | 0 | 4 | 0 | 1 |
128 + 32 + 4 + 1 = 165. The binary number 10100101 equals 165 in denary.
Converting denary to binary: the division method
Divide the denary number by 2. Write down the remainder (0 or 1). Divide the result by 2 again. Repeat until you reach 0. Read the remainders from bottom to top.
Example: Convert 38 to binary.
Hexadecimal: binary in disguise
Hexadecimal (base 16) uses sixteen digits. The first ten are the usual 0 through 9. Then instead of inventing new symbols, it borrows letters from the alphabet: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
Notice that each hex digit maps to exactly 4 binary bits. This is the 4-bit grouping trick and it is the most useful shortcut in this whole topic.
To convert hex to binary, replace each hex digit with its 4-bit binary equivalent. AD = 1010 1101.
Why does hex exist?
Binary numbers are accurate but hard to read. A memory address like 1010110100111011 contains 16 bits and is easy to misread. In hex that is AD3B -- four characters, easier to copy, harder to get wrong. Programmers and engineers use hex as human-friendly shorthand for binary values.
You see hex everywhere: HTML colour codes like #FF6B2B, MAC addresses like A4:C3:F0:1D:2E:88, and memory addresses in debuggers.
Converting hex to denary
Method 1 (via binary): Convert each hex digit to 4 bits, then read the whole binary number using place values. Method 2 (direct): Multiply the left digit by 16, add the right digit.
Converting denary to hex
Divide the denary number by 16. The quotient gives the left hex digit; the remainder gives the right hex digit. If either value is 10 or above, convert it to the corresponding letter (10=A, 11=B ... 15=F).
Binary Conversion Trainer
Binary Conversion Trainer
InteractiveClick any bit to toggle it on or off. Watch the denary and hex values update instantly.
Enter a denary number (0-255). The tool shows the division method step by step.
Toggle bits in either 4-bit group. See how two groups combine to form a 2-digit hex number.
- Conversion tables: you may be asked to fill in missing denary, binary and hex values in the same table. Practice all three in one go.
- Show your working on any conversion. A correct answer with no working shown typically loses a mark.
- Minimum bits questions: "What is the minimum number of bits needed to represent 240 different colours?" Answer: 8 bits (since 27=128 which is too small, 28=256 which is enough).
- Hex is always written in upper case in mark schemes (D7, not d7). Match this habit.
- The leftmost bit in an 8-bit binary number has the value 128, not 64. The most common place-value error is shifting the table by one position.
Check your understanding
Think Deeper
Practice what you've learned
Three printable worksheets covering number systems at three levels: Recall, Apply, and Exam-style.
Conversion questions: Marks are typically awarded for correct method AND correct answer. A student who shows clear working (division table or place-value table) but makes an arithmetic error may still earn the method mark. Always insist students show working.
Minimum bits questions: The answer must be justified. "8 bits" alone scores 0 on a 2-mark question. "8 bits because 28=256 which is the smallest power of 2 greater than or equal to 150" scores both marks.
Why binary questions: Accept any answer that refers to transistors, switches, or electronic components having two stable states. "Because it is easier" scores 0. "Because computers use switches that can only be on or off" scores the mark.