Show Working
Open the app

GCSE Computer ScienceEvery exam board

Binary to denary: how to convert, both ways

Denary is the ordinary base 10 number system. Binary is base 2 and uses only 0 and 1. At GCSE you convert 8-bit numbers, 0 to 255, between binary, denary and hexadecimal.

1286432168421
10110101

10110101 = 128 + 32 + 16 + 4 + 1 = 181

The rules Quiz yourself: 14 questions

Worked example: binary to denary

What is the binary number 10011101 in denary?

  1. Each bit has a place value. From the right they double: 1, 2, 4, 8, 16, 32, 64, 128.
  2. Match the bits to the place values. The 1s are under 128, 16, 8, 4 and 1.
  3. Add those place values: 128 + 16 + 8 + 4 + 1 = 157.

Answer 157

01 / The rulesLearn these

The methods, step by step

Binary to denary

Write the place values 128, 64, 32, 16, 8, 4, 2, 1 over the 8 bits. Add up the place values that have a 1 under them.

Every board

Denary to binary

Start at 128. If it fits into what is left, write 1 and take it away; if not, write 0. Move to 64 and repeat. 200 = 128 + 64 + 8, so 200 is 11001000.

Every board

Binary to hex

Split the byte into two nibbles of 4 bits. Each nibble is 0 to 15, which is one hex digit. 1101 1010 is 13 and 10, so DA.

Every board

The hex digits

0 to 9 are as normal, then A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

Every board

Hex to denary

Multiply the first digit by 16 and add the second. 6B = 6 × 16 + 11 = 107.

OCR, AQA and Eduqas

Denary to hex

Divide by 16. The whole number is the first digit and the remainder is the second. 107 ÷ 16 = 6 remainder 11, so 6B.

OCR, AQA and Eduqas

How much bits can hold

n bits can hold 2n different values, from 0 to 2n − 1. One byte, 8 bits, holds 256 values: 0 to 255.

Every board

Worth knowing

Hexadecimal is used because it is shorter than binary, so people read and write it with fewer mistakes. Every hex digit stands for exactly 4 bits, which is why converting between the two is quick. You meet it in colour codes and MAC addresses.

02 / Quiz yourselfTry it, then tap to check

Binary to denary questions to try

Work each one out on paper first, then open the answer and compare your working with ours. Every question here was made and checked by the Show Working app.

01 / Binary to denaryEvery board

What is the binary number 10011101 in denary?

Show the answer and working
  1. Each bit has a place value. From the right they double: 1, 2, 4, 8, 16, 32, 64, 128.
  2. Match the bits to the place values. The 1s are under 128, 16, 8, 4 and 1.
  3. Add those place values: 128 + 16 + 8 + 4 + 1 = 157.

Answer 157

02 / Binary to denaryEvery board

A byte in memory holds 11101000. What is this number in denary?

Show the answer and working
  1. Each bit has a place value. From the right they double: 1, 2, 4, 8, 16, 32, 64, 128.
  2. Match the bits to the place values. The 1s are under 128, 64, 32 and 8.
  3. Add those place values: 128 + 64 + 32 + 8 = 232.

Answer 232

03 / Denary to binaryEvery board

A program stores the number 159 in one byte. What 8 bits are stored?

Show the answer and working
  1. Write the 8 place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. Go from the left. When a place value fits into what is left, write 1 under it and take it away. When it does not fit, write 0.
  3. 128 fits: 159 − 128 = 31. 16 fits: 31 − 16 = 15. 8 fits: 15 − 8 = 7. 4 fits: 7 − 4 = 3. 2 fits: 3 − 2 = 1. 1 fits: 1 − 1 = 0.
  4. 64 and 32 do not fit when they are reached, so they get 0.
  5. So the binary number is 10011111.
  6. Check: 128 + 16 + 8 + 4 + 2 + 1 = 159.

Answer 10011111

04 / Denary to binaryEvery board

Write 233 as an 8-bit binary number.

Show the answer and working
  1. Write the 8 place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. Go from the left. When a place value fits into what is left, write 1 under it and take it away. When it does not fit, write 0.
  3. 128 fits: 233 − 128 = 105. 64 fits: 105 − 64 = 41. 32 fits: 41 − 32 = 9. 8 fits: 9 − 8 = 1. 1 fits: 1 − 1 = 0.
  4. 16, 4 and 2 do not fit when they are reached, so they get 0.
  5. So the binary number is 11101001.
  6. Check: 128 + 64 + 32 + 8 + 1 = 233.

Answer 11101001

05 / Binary to hexadecimalEvery board

Convert the 8-bit binary number 11111011 to hexadecimal.

Show the answer and working
  1. Split the byte into two nibbles of 4 bits: 1111 and 1011.
  2. In each nibble the place values are 8, 4, 2, 1.
  3. 1111 is 8 + 4 + 2 + 1 = 15, which is F in hex.
  4. 1011 is 8 + 2 + 1 = 11, which is B in hex.
  5. So 11111011 is FB. In hex, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

Answer FB

06 / Binary to hexadecimalEvery board

Convert the 8-bit binary number 00010101 to hexadecimal.

Show the answer and working
  1. Split the byte into two nibbles of 4 bits: 0001 and 0101.
  2. In each nibble the place values are 8, 4, 2, 1.
  3. 0001 is 1, which is 1 in hex.
  4. 0101 is 4 + 1 = 5, which is 5 in hex.
  5. So 00010101 is 15.

Answer 15

07 / Hexadecimal to binaryEvery board

Convert the hexadecimal number FB to an 8-bit binary number.

Show the answer and working
  1. Each hex digit becomes one nibble of 4 bits, with place values 8, 4, 2, 1.
  2. F is 15 = 8 + 4 + 2 + 1, so its nibble is 1111.
  3. B is 11 = 8 + 2 + 1, so its nibble is 1011.
  4. Put the two nibbles together: 11111011. (In hex, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.)

Answer 11111011

08 / Hexadecimal to binaryEvery board

Convert the hexadecimal number 15 to an 8-bit binary number.

Show the answer and working
  1. Each hex digit becomes one nibble of 4 bits, with place values 8, 4, 2, 1.
  2. 1 is 1, so its nibble is 0001.
  3. 5 is 5 = 4 + 1, so its nibble is 0101.
  4. Put the two nibbles together: 00010101.

Answer 00010101

09 / Hexadecimal to denaryOCR, AQA, Eduqas

Convert the hexadecimal number FB to denary.

Show the answer and working
  1. In a 2-digit hex number the left digit counts 16s and the right digit counts 1s.
  2. F is 15 and B is 11. In hex, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
  3. 15 × 16 + 11 = 240 + 11 = 251.

Answer 251

10 / Hexadecimal to denaryOCR, AQA, Eduqas

What is the hex number 15 in denary?

Show the answer and working
  1. In a 2-digit hex number the left digit counts 16s and the right digit counts 1s.
  2. 1 is 1 and 5 is 5.
  3. 1 × 16 + 5 = 16 + 5 = 21.

Answer 21

11 / Denary to hexadecimalOCR, AQA, Eduqas

Convert the denary number 251 to hexadecimal.

Show the answer and working
  1. Divide by 16. The number of whole 16s is the left digit and the remainder is the right digit.
  2. 251 ÷ 16 is 15 remainder 11, because 15 × 16 = 240 and 251 − 240 = 11.
  3. 15 is F and 11 is B in hex. In hex, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
  4. So 251 is FB in hex.
  5. Or go through binary: 251 is 1111 1011. The nibble 1111 is F and 1011 is B.

Answer FB

12 / Denary to hexadecimalOCR, AQA, Eduqas

Write 21 as a 2-digit hex number.

Show the answer and working
  1. Divide by 16. The number of whole 16s is the left digit and the remainder is the right digit.
  2. 21 ÷ 16 is 1 remainder 5, because 1 × 16 = 16 and 21 − 16 = 5.
  3. 1 is 1 and 5 is 5 in hex.
  4. So 21 is 15 in hex.
  5. Or go through binary: 21 is 0001 0101. The nibble 0001 is 1 and 0101 is 5.

Answer 15

13 / How many numbers bits can holdEvery board

How many different values can be stored in 10 bits?

Show the answer and working
  1. Each bit can be 0 or 1, so every extra bit doubles the number of patterns.
  2. 10 bits give 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 210 = 1024 different values.
  3. They go from 0000000000 (0) to 1111111111 (1023).

Answer 1024

14 / How many numbers bits can holdEvery board

A sensor records whole numbers from 0 to 64. What is the smallest number of bits that can store every reading?

Show the answer and working
  1. With n bits the largest number is all 1s, which is 2 to the power n, take away 1.
  2. 6 bits go up to 26 − 1 = 63, which is less than 64. Not enough.
  3. 7 bits go up to 27 − 1 = 127, which is enough for 64.
  4. So the fewest bits is 7.

Answer 7

03 / By exam boardNot affiliated with any board

Binary to denary on each exam board

OCR (J277)Binary, denary and hex in every direction, up to 8 bits, plus binary addition and shifts.
AQA (8525)Binary, denary and hex in every direction, plus binary addition and shifts.
Edexcel (1CP2)Binary and denary, and hex to and from binary. Two's complement for negative numbers too.
EduqasBinary, denary and hex, two's complement, and sign and magnitude.

Show Working is not affiliated with AQA, Edexcel (Pearson), OCR or WJEC Eduqas. Check your own board's specification for the exact wording.

04 / QuestionsGCSE Computer Science

Binary to denary, answered

How do you convert binary to denary?

Write the place values 128, 64, 32, 16, 8, 4, 2 and 1 above the eight bits, then add up the place values that have a 1 under them. 00001011 is 8 + 2 + 1 = 11.

What is the largest number you can store in 8 bits?

255, which is 11111111 in binary and FF in hexadecimal. Eight bits hold 256 different values, from 0 to 255.

Why do computers use binary?

A computer is built from billions of tiny switches that are either on or off. Binary has only two digits, 1 and 0, so it matches those two states.

Why is hexadecimal used?

It is a shorter way to write binary. One hex digit stands for 4 bits, so a byte is just two hex digits. That makes long binary numbers easier for people to read, remember and type correctly.

What is a nibble?

Four bits, half a byte. A nibble can hold 16 values, 0 to 15, which is exactly one hexadecimal digit.

05 / Practise itiPhone, iPad and the web

More binary to denary questions in Show Working

The app makes fresh binary to denary questions every time, so they never run out. Get one wrong and you see every step of the working.

The worked answer in Show Working: the answer, then numbered steps in plain words

Show WorkingFree on the App StoreFree in your browser, no download

Open it free