Intermediate

Hexadecimal Representation

AicademyAicademy
·GCSE Computer Science·AQA 8525·7 slides
3.3.1 Number bases·3.3.2 Converting between number bases

What Is Hexadecimal?

Hexadecimal (hex) is a base-16 number system. Where binary uses two digits (0–1) and denary uses ten (0–9), hexadecimal uses sixteen: 0–9 followed by A–F to represent the values ten through fifteen in a single character.

Computers store everything in binary, but long binary strings — for example, a 32-bit memory address — are difficult to read and prone to transcription error. Hexadecimal solves this by providing a compact notation: every 4 binary bits map exactly to a single hex digit, making the conversion lossless.

Where hex appearsExample
Web colour codes#FF5733
Memory addresses0x1A2F
MAC addressesA8:5E:45:6B:3C:71
Error codes0x000000ED

Hex is used in computing not because it is intuitive, but because 4 bits = 1 hex digit. Binary-to-hex conversion is exact, with no rounding or information loss.

Hex Digit Values

The sixteen hex digits and their denary equivalents must be memorised. Digits 0–9 behave identically to denary; A–F replace the two-digit denary values 10–15 with a single character.

HexDenary4-bit binary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

The most common error here is treating A as 11 rather than 10. A is the first letter after the digits, and 10 is the first value after 9. Each subsequent letter adds one: B = 11, C = 12, D = 13, E = 14, F = 15.

Converting Hex to Denary

Each hex digit represents a power of 16, starting from at the rightmost position. Multiply each digit by its place value, substituting the denary equivalent for any letter, then sum the results.

For a 2-digit hex number:

PositionPlace value
Left digit
Right digit

Worked example 1 — convert 2A to denary:

  • 2 × 16 = 32
  • A (= 10) × 1 = 10
  • Total: 32 + 10 = 42

Worked example 2 — convert B7 to denary:

  • B (= 11) × 16 = 176
  • 7 × 1 = 7
  • Total: 176 + 7 = 183

Substitute the denary value for each letter before multiplying. Multiplying "A" directly is a common source of arithmetic errors.

4 more slides

Continue this lesson

Create a free account to unlock all 7 slides, track your progress, and ask the AI tutor for help.

Related lessons

7 Slides

Lesson

ASCII and Unicode: Character Encoding

GCSE Computer Science · AQA 8525

1 day ago