GCSE Computer Science · public explanation

Number Systems and Conversions

Convert between binary, denary and hexadecimal using place value. Follow worked GCSE examples and understand why hexadecimal is useful in computing.

Read the explanation and worked examples, then choose your exam board to continue with activities and practice in your account.

OCR J277On the specificationOCR J277 1.2.4

Binary and hexadecimal number systems, unsigned conversions and hexadecimal uses.

AQA 8525 (2027+)On the specificationAQA 8525 3.3.1–3.3.2

Unsigned values 0–255; binary, denary and hexadecimal conversions.

One quantity, three ways to write it

Denary is base 10, binary is base 2 and hexadecimal is base 16. Changing the base changes the notation, not the quantity. A bit has two possible values, 0 and 1; an eight-bit unsigned value represents integers from 0 to 255.

Binary place values double as you move left. A 1 includes that place value in the total; a 0 does not. Leading zeroes preserve a requested width without changing the value.

Place value1286432168421
1010110110101101

Read 10101101

  1. Select the columns containing 1: 128, 32, 8, 4 and 1.
  2. Add those values: 128 + 32 + 8 + 4 + 1 = 173.

10101101 in binary and 173 in denary represent the same integer.

Build the binary value from the largest places

To convert an unsigned denary number to eight bits, inspect each place from 128 down to 1. Write 1 when that place fits the remaining value, subtract it, then continue. Otherwise write 0.

Convert 173

  1. 173 includes 128: write 1 and keep remainder 45.
  2. 64 does not fit; 32 fits, leaving 13. The first three bits are 101.
  3. 16 does not fit; 8 fits, leaving 5; 4 fits, leaving 1.
  4. 2 does not fit; 1 fits. Result: 10101101.
  5. Check: 128 + 32 + 8 + 4 + 1 = 173.

Keep all eight columns in order; do not squeeze out the zero columns.

A hexadecimal digit can hold four bits

Hexadecimal uses 0–9 and then A, B, C, D, E and F for ten through fifteen. In a two-digit hexadecimal value, the left digit counts sixteens and the right digit counts ones.

Four bits have sixteen combinations, so split an eight-bit number into two groups of four. Convert each group separately, keeping zeroes inside each group.

Hex digitABCDEF
Denary101112131415
Binary101010111100110111101111

Connect AD, 10101101 and 173

  1. Split 10101101 as 1010 | 1101.
  2. 1010 is ten, written A. 1101 is thirteen, written D.
  3. AD in denary is 10 × 16 + 13 = 173.

AD is not 10 + 13: the A occupies the sixteens column.

Why people use hexadecimal

Computers ultimately store binary patterns. Hexadecimal is a compact, readable way for people to represent those patterns, for example in a memory address or a colour value. It is not a different kind of memory, and it does not make the underlying bit pattern smaller.

Continue with your exam board

The course combines lesson videos, interactive activities, topic questions and original exam mocks. Sign in to use the learning tools and save your progress; your account’s course access applies.

Independent learning resources. Not endorsed by AQA or OCR. These public introductions complement the full course and the official specification.