Computer Science ยท WCP01 (Unit 1)

Binary and hexadecimal

Computers store everything as binary. Hexadecimal is a short way for people to write binary.

Binary place values

Each binary digit (bit) is a power of 2. For 8 bits: 128, 64, 32, 16, 8, 4, 2, 1. 10110010 = 128 + 32 + 16 + 2 = 178. Eight bits make a byte, which holds 0 to 255.

Hexadecimal

Base 16 uses 0 to 9 then A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. One hex digit stands for exactly 4 bits (a nibble).

Converting

Binary to hex: split into groups of 4 from the right and convert each. 1011 0010 = B2. Hex to denary: B2 = 11 x 16 + 2 = 178.

Worked example

Convert 0111 1110 to hexadecimal.

  1. 0111 = 7
  2. 1110 = 14 = E

Answer: 7E

Key idea: Bits are powers of 2; one hex digit = 4 bits; A to F are 10 to 15.

Check yourself

  1. Convert binary 00101101 to denary.
    Show answer

    45. 32 + 8 + 4 + 1 = 45.

  2. Convert hex 3F to denary.
    Show answer

    63. 3 x 16 + 15 = 63.

  3. Convert binary 1100 1010 to hexadecimal.
    Show answer

    CA. 1100 = 12 = C; 1010 = 10 = A.

  4. What is the largest denary number one byte can hold (unsigned)?
    Show answer

    255. 11111111 = 255.

  5. How many bits does one hexadecimal digit represent?
    Show answer

    4. 16 = 24, so one hex digit = 4 bits.

Practise with instant feedback

Sources

Last updated 7 November 2026. Spotted a mistake? Email alevel@lifereadysociety.com.