Sunday, 22 September 2013

ISBN check digit

What The ISBN Check Digit Is For

The check digit in an ISBN number is there to help prevent errors in transmission. When an ISBN number is read and entered into any system that is used to deal with ISBNs, such as a book cataloguing system, whether the ISBN is entered by hand or by means of a bar code scanner, the check digit as read from the entered number is compared to a check digit calculated from the remainder of the ISBN that has been entered. If the two check digits are the same, then there is a good chance that the complete ISBN, all of its digits, has been read correctly.

How The ISBN Check Digit Is Calculated

  1. Take the first 12 digits of the 13-digit ISBN
  2. Multiply each number in turn, from left to right by a number. The first digit is multiplied by 1, the second by 3, the third by 1 again, the fourth by 3 again, and so on to the eleventh which is multiplied by 1 and the twelfth by 3.
  3. Add all of the 12 answers.
  4. Do a modulo 10 division on the result from step 2. (Don't know what a modulo 10 division is? It's easy. It's just the remainder from a whole number division by 10.)
  5. Take that remainder result from step 4.If it's a zero, then the check digit is zero. If the remainders isn't zero then subtract the remainder from 10. The answer to that is your check digit.

First Example - correct ISBN - 9781861972712

First 12 digits x their multipliers = the results

9 x 1 = 9
7 x 3 = 21
8 x 1 = 8
1 x 3 = 3
8 x 1 = 8
6 x 3 = 18
1 x 1 = 1
9 x 3 = 27
7 x 1 = 7
2 x 3 = 6
7 x 1 = 7
1 x 3 = 3

Add the results:
9 + 21 + 8 + 3 + 8 + 18 + 1 + 27 + 7 + 6 + 7 + 3 = 118

Modulo 10 the result:
118 modulo 10 = 110 remainder 8

Work out the check digit:
8 doesn't equal zero, so check digit = 10 - 8 = 2

Compare the calculated check digit (2) with the one we first entered (2). They are the same, so looks like we have a good ISBN.

References:

No comments:

Post a Comment