Hexadecimal Cambridge IGCSE Computer Science revision

Not started

Learn it

In plain words

Long strings of 1s and 0s are hard for people to read and easy to mistype. Hexadecimal, or hex, is a shorthand: base 16, where one hex digit stands for exactly four bits.

Base 16 needs sixteen digits, so after 9 it borrows letters: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

7 things to know

  1. Hexadecimal is base 16. Its digits are 0 to 9 and then A to F for 10 to 15.
  2. Binary to hex: split the bits into groups of four, starting from the right. Convert each group to one hex digit.
  3. Hex to binary: turn each hex digit into its own four bits.
  4. Hex to denary: the place values are 1, 16, 256, 4096. Multiply each digit by its place value and add.
  5. Denary to hex: divide by 16. The whole-number answer is the first digit and the remainder is the second.
  6. Hex is used because it is shorter than binary, easier for people to read and write, and so less likely to be copied wrongly. The computer itself still works in binary.
  7. Where you meet it: MAC addresses, IPv6 addresses, colour codes in web pages (such as #FF8800), memory addresses and error codes.

Worked example

Convert the binary number 10111100 to hexadecimal.

  1. Split it into two groups of four: 1011 and 1100.
  2. 1011 = 8 + 2 + 1 = 11, which is B. 1100 = 8 + 4 = 12, which is C.
  3. 10111100 = BC.

Worked example

Convert the denary number 200 to hexadecimal.

  1. 200 ÷ 16 = 12 remainder 8.
  2. 12 is C, and the remainder is 8.
  3. 200 = C8.

Tips and tricks

  • Going between hex and denary with big numbers is easiest through binary: one hex digit, four bits.
  • "Why is hex used?" is about people, not machines. Never say the computer runs faster or saves memory.
7 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Hexadecimal: 7 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. Which hex digit stands for the denary number 13?
    • C
    • D (the answer)
    • E
    • 13

    A = 10, B = 11, C = 12, D = 13.

  2. What is the binary number 11110101 in hexadecimal?
    • E5
    • F5 (the answer)
    • 5F
    • FA

    1111 = F and 0101 = 5.

  3. What is the hexadecimal number 3A in denary?
    • 13
    • 42
    • 58 (the answer)
    • 310

    3 × 16 + 10 = 58.

  4. Why do programmers use hexadecimal instead of binary?
    • Computers process hexadecimal faster.
    • Hexadecimal takes up less memory.
    • It is shorter and easier for people to read. (the answer)
    • It can store negative numbers.

    It is a convenience for humans. Inside the computer it is still binary.

  5. Which of these is usually written in hexadecimal?
    • the clock speed of a CPU
    • a MAC address (the answer)
    • the capacity of a hard disk
    • a telephone number

    MAC addresses, IPv6 addresses and web colour codes are all written in hex.

  6. What is the denary number 255 in hexadecimal?Stretch
    • EE
    • F0
    • FF (the answer)
    • 100

    255 ÷ 16 = 15 remainder 15, and 15 is F.

  7. What is the hexadecimal number 1F4 in denary?Stretch
    • 319
    • 484
    • 500 (the answer)
    • 1154

    1 × 256 + 15 × 16 + 4 = 256 + 240 + 4.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf