A1.2.1 Ways of representing data: binary, hexadecimal and more
SL + HLCommand term: Describe1. Flip the bits
Each bit has a place value that doubles from right to left. Click a bit to switch it between 0 and 1. The orange and green underlines show the two nibbles (groups of 4 bits) that make each hex digit.
2. Step-by-step converter
Choose a conversion, type a number, then click Next step to see the working, exactly as you would write it in an exam.
3. Quick-fire practice
Learning objectives
By the end of this page you should be able to:
- Describe the binary, denary and hexadecimal number systems and their place values.
- Convert whole numbers between binary and denary.
- Convert whole numbers between hexadecimal and denary.
- Convert between binary and hexadecimal by grouping bits into nibbles.
- Calculate how many different values can be represented with a given number of bits.
Number bases
- Denary (decimal), base 10: digits 0–9; place values 1, 10, 100, 1000…
- Binary, base 2: digits 0 and 1 (bits); place values 1, 2, 4, 8, 16, 32, 64, 128… Computers use binary because transistors have two states: on and off.
- Hexadecimal, base 16: digits 0–9 then A–F (A = 10 … F = 15); place values 1, 16, 256, 4096… Hex is a compact, human-friendly way to write binary: one hex digit = exactly 4 bits. It's used for memory addresses, colour codes (#FF8800) and MAC addresses.
Conversions
| Conversion | Method | Example |
|---|---|---|
| Binary → denary | Write the place values above the bits; add the place values where there is a 1. | 1011 0010 = 128+32+16+2 = 178 |
| Denary → binary | Subtract the largest place value that fits, write 1, repeat (or divide by 2 repeatedly and read the remainders from bottom to top). | 45 = 32+8+4+1 = 0010 1101 |
| Hex → denary | Multiply each digit by its place value (16ⁿ) and add. | 2F = 2×16 + 15 = 47 |
| Denary → hex | Divide by 16: the quotient is the first digit and the remainder the second (or convert to binary, then group into 4s). | 200 = 12×16 + 8 = C8 |
| Binary → hex | Split into groups of 4 bits from the right (pad with zeros); convert each group. | 1110 0101 = E 5 = E5 |
| Hex → binary | Replace each hex digit with its 4-bit pattern. | 3A = 0011 1010 |
How many values?
n bits can represent 2ⁿ different values, from 0 to 2ⁿ − 1. For example, 4 bits = 16 values (0–15), 8 bits (a byte) = 256 values (0–255), and 16 bits = 65,536 values (0–65,535).
Use the 中文 button at the top to show or hide the Chinese terms.
| Term | 中文 | Meaning |
|---|
Choose an answer. You get instant feedback.
Score: 0 /
Write your answer first, then reveal the markscheme. These are exam-style practice questions written for this site.
1. Convert the binary number 1101 0110 to denary. Show your working. [2]
2. Convert the denary number 93 to 8-bit binary. [2]
3. Convert the hexadecimal number B7 to binary and to denary. [2]
4. Explain why programmers often use hexadecimal rather than binary. [2]
5. State the largest denary number that can be stored in 12 bits, and the number of different values 12 bits can represent. [2]