Hexadecimal in Computer Science (AQA GCSE Computer Science): Revision Notes
Hexadecimal in computer science
What is hexadecimal?
Hexadecimal (often called "hex") is a number system that uses base 16 instead of the base 10 system we normally use. While our everyday decimal system uses digits 0-9, hexadecimal uses digits 0-9 and then continues with letters A, B, C, D, E, and F to represent the values 10, 11, 12, 13, 14, and 15.
The letters A-F in hexadecimal represent the decimal values 10-15 respectively:
- A = 10, B = 11, C = 12, D = 13, E = 14, F = 15
This might seem strange at first, but hexadecimal is incredibly useful in computer science because it works perfectly with how computers actually store and process information.
Understanding different number systems
To understand why hexadecimal matters, we need to compare it with the two other important number systems used in computing: decimal (base 10) and binary (base 2).

Looking at this conversion table, you can see how the same numerical value appears differently in each system. For example, what we call "10" in decimal becomes "1010" in binary and "A" in hexadecimal. The pattern shows that as numbers get larger, binary representations become very long and difficult to work with, while hexadecimal stays compact and readable.
The key insight is that hexadecimal column values work on multiples of 16. So the first column represents ones, the second column represents sixteens (16 × 1), the third would represent 256s (16 × 16), and so on.
Why computers use binary representation
Computers are fundamentally built from millions of tiny electronic switches. Each switch can only be in one of two states: either on (represented as 1) or off (represented as 0). This is why computers naturally work in binary - it directly matches their physical structure.
Everything stored in a computer gets converted to binary. This includes all types of data:
- Numbers and calculations
- Text and letters
- Images and graphics
- Sound recordings
- Video files
- Programme instructions
Binary Data Representation:
The binary sequence 01000100 could represent many different things depending on the context:
- Part of a digital image
- A small piece of a sound recording
- The letter 'D'
- The number 68
The computer needs additional information to know how to interpret each binary sequence correctly.
Why programmers use hexadecimal
While computers work perfectly with binary, it creates a problem for the humans who programme them. Binary numbers quickly become very long and difficult to read or remember. Imagine trying to work with binary numbers like 11011100 and 11011000 - they look almost identical but represent different values!
Binary vs Hexadecimal Comparison:
These long binary numbers:
- 11011100 → DC in hexadecimal
- 11011000 → D8 in hexadecimal
Suddenly, they're much easier to distinguish, remember, and work with!
Hexadecimal provides the perfect balance:
- It's much more compact than binary (shorter numbers)
- It converts easily to and from binary (which we'll learn about next)
- It's still precise and unambiguous
- Programmers can spot patterns and differences quickly
Practical applications
Hexadecimal appears everywhere in computer science:
- Memory addresses: Computers use hex to identify locations in memory
- Color codes: Web designers use hex codes like #FF0000 for colours
- Machine code: Programming instructions are often displayed in hex
- Network protocols: Internet addresses and data packets use hexadecimal
- Debugging: Programmers examine computer memory using hex displays
The beauty of hexadecimal is that it makes the complex binary world of computers accessible to human programmers while maintaining perfect accuracy in the conversion process.
Remember!
Key Points to Remember:
- Hexadecimal uses base 16 with digits 0-9 and letters A-F representing values 0-15
- Computers work in binary because they're built from switches that are either on (1) or off (0)
- Binary numbers become very long and difficult for humans to read and work with
- Hexadecimal is much more compact than binary while being easy to convert back and forth
- Programmers prefer hex because it's readable, memorable, and reveals patterns that are hidden in long binary sequences