Home › Theme A › A1 › A1.2 › A1.2.1

A1.2.1 Ways of representing data: binary, hexadecimal and more

SL + HLCommand term: Describe

1. Flip the bits

Each bit has a place value that doubles from right to left. Click a bit to switch it between 0 and 1. The orange and green underlines show the two nibbles (groups of 4 bits) that make each hex digit.

Binary (base 2)00000000
Denary (base 10)0
Hexadecimal (base 16)00
With 8 bits you can make 2⁸ = 256 different values: 0 to 255.

2. Step-by-step converter

Choose a conversion, type a number, then click Next step to see the working, exactly as you would write it in an exam.

Your working will appear here.

3. Quick-fire practice

✅ Correct: 0 · 🔥 Streak: 0 · 🏆 Best: 0

Learning objectives

By the end of this page you should be able to:

  1. Describe the binary, denary and hexadecimal number systems and their place values.
  2. Convert whole numbers between binary and denary.
  3. Convert whole numbers between hexadecimal and denary.
  4. Convert between binary and hexadecimal by grouping bits into nibbles.
  5. Calculate how many different values can be represented with a given number of bits.

Number bases

  • Denary (decimal), base 10: digits 0–9; place values 1, 10, 100, 1000…
  • Binary, base 2: digits 0 and 1 (bits); place values 1, 2, 4, 8, 16, 32, 64, 128… Computers use binary because transistors have two states: on and off.
  • Hexadecimal, base 16: digits 0–9 then A–F (A = 10 … F = 15); place values 1, 16, 256, 4096… Hex is a compact, human-friendly way to write binary: one hex digit = exactly 4 bits. It's used for memory addresses, colour codes (#FF8800) and MAC addresses.

Conversions

ConversionMethodExample
Binary → denaryWrite the place values above the bits; add the place values where there is a 1.1011 0010 = 128+32+16+2 = 178
Denary → binarySubtract the largest place value that fits, write 1, repeat (or divide by 2 repeatedly and read the remainders from bottom to top).45 = 32+8+4+1 = 0010 1101
Hex → denaryMultiply each digit by its place value (16ⁿ) and add.2F = 2×16 + 15 = 47
Denary → hexDivide by 16: the quotient is the first digit and the remainder the second (or convert to binary, then group into 4s).200 = 12×16 + 8 = C8
Binary → hexSplit into groups of 4 bits from the right (pad with zeros); convert each group.1110 0101 = E 5 = E5
Hex → binaryReplace each hex digit with its 4-bit pattern.3A = 0011 1010

How many values?

n bits can represent 2ⁿ different values, from 0 to 2ⁿ − 1. For example, 4 bits = 16 values (0–15), 8 bits (a byte) = 256 values (0–255), and 16 bits = 65,536 values (0–65,535).

Exam tip: always show your working: write the place values, or the divisions. Method marks are often available even if the final answer has a slip.

Use the 中文 button at the top to show or hide the Chinese terms.

Term中文Meaning

Choose an answer. You get instant feedback.

Score: 0 /

Write your answer first, then reveal the markscheme. These are exam-style practice questions written for this site.

1. Convert the binary number 1101 0110 to denary. Show your working. [2]

128 + 64 + 16 + 4 + 2 [1 for working]; = 214 [1].

2. Convert the denary number 93 to 8-bit binary. [2]

93 = 64 + 16 + 8 + 4 + 1 [1]; = 0101 1101 [1].

3. Convert the hexadecimal number B7 to binary and to denary. [2]

Binary: B = 1011, 7 = 0111, so 1011 0111 [1]; denary: 11 × 16 + 7 = 183 [1].

4. Explain why programmers often use hexadecimal rather than binary. [2]

Hexadecimal is shorter / more compact, so it is easier to read, write and remember [1]; each hex digit maps directly to 4 bits, so it converts to and from binary easily, with fewer errors [1].

5. State the largest denary number that can be stored in 12 bits, and the number of different values 12 bits can represent. [2]

Largest: 2¹² − 1 = 4095 [1]; number of values: 2¹² = 4096 [1].