← IGCSE Computer Science Paper 1

ISBN-13 check digit

The last digit of an ISBN-13, found by weighting the first 12 digits 1 and 3 alternately, adding them, and choosing the digit that makes the total a multiple of 10.

Understanding ISBN-13 check digit in IGCSE Computer Science Paper 1

What it does: 87 MOD 10 is 7, and 10 - 7 = 3, so the check digit is 3 and the new total is 90. The weights alternate 1, 3, 1, 3 and continue across all 12 digits, so even-numbered positions get weight 3. An ISBN (International Standard Book Number) identifies a book edition. Scanners use it to look the book up. ISBN-13 alternates weights 1 and 3. Counting-down weights belong to the older ISBN-10. The first 12 digits are weighted and added. The 13th digit is the check digit worked out from them. Odd positions (1st, 3rd, 5th ...) are multiplied by 1. Even positions (2nd, 4th, 6th ...) are multiplied by 3.

Common mistakes: The weights alternate 1, 3, 1, 3, so odd positions (1st, 3rd, ...) get weight 1 and even positions get weight 3. The test should be i MOD 2 = 0 so that only the even positions get weight 3. DIV gives the whole-number quotient, not the remainder. The check digit depends on the remainder after dividing by 10, so the line should be r ← total MOD 10.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 168–178) and word search (Modules 168–188).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does an ISBN identify?
A person who borrows booksA particular book
Matches
total = d1*3 + d2*1 + d3*3 + d4*1
↓
The weights are the wrong way round. The first digit must be multiplied by 1, not 3.
Applying
Meanings
Term
ISBN-13 check digit
Meaning
The last digit of an ISBN-13, found by weighting the first 12 digits 1 and 3 alternately, adding them, and choosing the digit that makes the total a multiple of 10.
Practice
total ← 0
Testing
Gaps
total ← d1*1 + d2* + d3*1 + d4*3
Check Answer
Spots
3 w ← 1
4 IF i MOD 2 = 1 THEN w ← 3

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Silverback Gorilla' badge — Savannah Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does an ISBN identify?
A. A particular book ✓
B. A person who borrows books
An ISBN (International Standard Book Number) identifies a book edition. Scanners use it to look the book up.
2. Which weights does ISBN-13 use on its first 12 digits?
A. 1, 3, 1, 3 ... alternating ✓
B. 10, 9, 8, 7 ... counting down
ISBN-13 alternates weights 1 and 3. Counting-down weights belong to the older ISBN-10.
3. Which digit of an ISBN-13 is the check digit?
A. The first digit
B. The last (13th) digit ✓
The first 12 digits are weighted and added. The 13th digit is the check digit worked out from them.
4. In ISBN-13, what weight is given to the 2nd digit?
A. 3 ✓
B. 1
Odd positions (1st, 3rd, 5th ...) are multiplied by 1. Even positions (2nd, 4th, 6th ...) are multiplied by 3.
5. The check digit is chosen so that the weighted total of all 13 digits is a multiple of what?
A. 11
B. 10 ✓
ISBN-13 uses modulus 10. ISBN-10 is the one that uses modulus 11.

Match the Pairs

weights: 1 3 1 3 1 3 1 3 1 3 1 3 → The first 12 digits of an ISBN-13 are multiplied by 1 and 3 alternately, starting with 1 for the first digit.
(10 - total MOD 10) MOD 10 → Finds the check digit: the number that must be added to the weighted total to reach the next multiple of 10.
The weighted total is 87, so the check digit must bring it up to 90. → check = (10 - 87 MOD 10) MOD 10 # 3
The ISBN-13 weights alternate 1 and 3, so digit 2 is multiplied by 3 and digit 3 is multiplied by 1. → total = d1*1 + d2*3 + d3*1 + d4*3
total = d1*3 + d2*1 + d3*3 + d4*1 → The weights are the wrong way round. The first digit must be multiplied by 1, not 3.
check = total MOD 10 → The remainder is not the check digit. The check digit is the amount needed to reach the next multiple of 10, so 10 minus the remainder (or 0 if the remainder is 0).

Key Term

ISBN-13 check digit
The last digit of an ISBN-13, found by weighting the first 12 digits 1 and 3 alternately, adding them, and choosing the digit that makes the total a multiple of 10.

Fill in the Blanks

1. total ← d1*1 + d2*3 + d3*1 + d4*3
Hint: Type the weight applied to every second digit (the other weight is 1).
2. remainder ← total MOD 10
Hint: Type the operator that gives the remainder after dividing by 10.
3. check ← (10 - remainder) MOD 10
Hint: Type the number the total must be a multiple of for ISBN-13. This stops a remainder of 0 giving a check digit of 10.
4. isbn10Valid ← (total MOD 11) = 0
Hint: Type the modulus used by the older ISBN-10 system.
5. FOR i ← 1 TO 12 total ← total + digit[i] * weight NEXT i
Hint: Type how many digits are weighted and added; the 13th digit is the check digit itself.

Spot the Error

Question 1
A total ← 0
B FOR i ← 1 TO 12
C w ← 1
D IF i MOD 2 = 1 THEN w ← 3
E total ← total + d[i] * w
F NEXT i
Line D — The weights alternate 1, 3, 1, 3, so odd positions (1st, 3rd, ...) get weight 1 and even positions get weight 3. The test should be i MOD 2 = 0 so that only the even positions get weight 3.
Question 2
A total ← 120
B r ← total DIV 10
C IF r = 0 THEN check ← 0
D ELSE check ← 10 - r
Line B — DIV gives the whole-number quotient, not the remainder. The check digit depends on the remainder after dividing by 10, so the line should be r ← total MOD 10.
Question 3
A isbn ← "978030640615"
B total ← 93
C remainder ← total MOD 10
D check ← remainder
E OUTPUT check
Line D — The check digit is the number that brings the total up to the next multiple of 10, so it is 10 - remainder (10 - 3 = 7). Using the remainder itself gives 3, which is wrong.
Question 4
A total ← 0
B FOR i ← 1 TO 9
C total ← total + d[i]*(10-i)
D NEXT i
E r ← total MOD 11
F check ← 11 - r
Line C — ISBN-10 weights the first 9 digits 10, 9, 8 ... 2. The weight for digit i is 11 - i, not 10 - i, which would give 9 down to 1.
Question 5
A total ← 0
B FOR i ← 1 TO 12
C total ← total + d[i] * w[i]
D NEXT i
E valid ← total MOD 10 = 0
Line B — When checking a complete ISBN-13, all 13 digits, including the check digit, must be weighted and added. The loop should run from 1 TO 13.

Student with a class code? Join your class →