Cambridge O Level Computer Science · Syllabus 2210 · Data Representation
Hexadecimal
What is Hexadecimal?
Hexadecimal is the base 16 number system, using the digits 0 to 9 and the letters A to F for the values 10 to 15, in which each hexadecimal digit represents exactly four binary bits.
This definition is part of the Data Representation chapter in Cambridge O Level Computer Science.
Hexadecimal in context
In any number system, a digit's value depends on which column it is in. Reading right to left, each column is worth the base times the column before it. In binary the columns are the powers of two: 1, 2, 4, 8, 16, 32, 64, 128… In hexadecimal they are the powers of sixteen: 1, 16, 256, 4096… Reading a number in any base is then just "multiply each digit by its column value and add the results".
Hexadecimal is used because it is easier for people to understand than binary: it is a much shorter representation of the same bit pattern, and each hexadecimal digit maps to exactly four bits, so converting between the two is quick and needs no arithmetic. A shorter string is quicker to read, quicker to write, quicker to say aloud and far less likely to be copied down wrongly. Hexadecimal is a notation for humans — the machine still stores the same binary.
Common mistakes with Hexadecimal
- 1. Treating a leading zero as optional. Why it fails A register has a fixed width. In an 8-bit register the value 12 is 00001100, not 1100. Inside a hexadecimal-to-binary conversion, 5 must become 0101, not 101, or every bit after it shifts one place and the whole answer is wrong. Fix Decide the width before you write anything, then pad on the left to fill it.
- M2. "Hexadecimal is a form of compression." Why it fails Compression reduces the number of bits stored. Hexadecimal changes only how the same bits are written for a person to read. Correct model Hexadecimal is a notation. FF and 11111111 are the same eight bits in storage. Exam-safe "Hexadecimal is a shorter way for humans to write binary; it does not change the amount of data stored." Test yourselfHideQ. How many bits does the value FF occupy in memory?A. Eight — the same as 11111111.
- M3. "A shorter hexadecimal string means less underlying data." Why it fails The length of the written string is a property of the notation, not of the storage. One hexadecimal digit always stands for four bits. Correct model A 4-digit hexadecimal value is always 16 bits, however short it looks next to the binary. Exam-safe "Each hexadecimal digit represents four bits, so a shorter written form still describes exactly the same number of bits." Test yourselfHideQ. How many bits does the hexadecimal value A35F represent?A. 4 digits × 4 bits = 16 bits.
Examiner tips on Hexadecimal
- The shortcut worth knowing. There is no direct route between denary and hexadecimal that is faster than going through binary for small values, but for anything over one byte the repeated-division method is quicker. And hexadecimal and binary convert directly, four bits at a time, with no arithmetic at all — so if you are ever asked for denary to hexadecimal and get stuck, convert to binary first, then group in fours.
Questions students ask about Hexadecimal
What is the difference between binary, denary and hexadecimal?
Denary is base 10, the number system people normally use, with column values that are powers of ten. Binary is base 2, using only the digits 0 and 1 with column values that are powers of two — the only form a computer actually stores. Hexadecimal is base 16, using the digits 0 to 9 and the letters A to F, with column values that are powers of sixteen. Each hexadecimal digit represents exactly four binary bits, so it is a much shorter way for people to write the same bit pattern.

