ISBN
<nowiki>ISBN-13</nowiki> check digit calculation
### ISBN\-13 check digit calculation

Appendix 1 of the International ISBN Agency's official user manual describes how the 13\-digit ISBN check digit is calculated. The ISBN\-13 check digit, which is the last digit of the ISBN, must range from 0 to 9 and must be such that the sum of all the thirteen digits, each multiplied by its (integer) weight, alternating between 1 and 3, is a multiple of [10](/wiki/10_%28number%29 "10 (number)"). As ISBN\-13 is a subset of [EAN\-13](/wiki/International_Article_Number%23Check_digit "International Article Number#Check digit"), the algorithm for calculating the check digit is exactly the same for both.

Formally, using [modular arithmetic](/wiki/Modular_arithmetic "Modular arithmetic"), this is rendered:

The calculation of an ISBN\-13 check digit begins with the first twelve digits of the 13\-digit ISBN (thus excluding the check digit itself). Each digit, from left to right, is alternately multiplied by 1 or 3, then those products are summed [modulo](/wiki/Modular_arithmetic "Modular arithmetic") 10 to give a value ranging from 0 to 9\. Subtracted from 10, that leaves a result from 1 to 10\. A zero replaces a ten, so, in all cases, a single check digit results.

For example, the ISBN\-13 check digit of 978\-0\-306\-40615\-*?* is calculated as follows:

```
s = 9×1 + 7×3 + 8×1 + 0×3 + 3×1 + 0×3 + 6×1 + 4×3 + 0×1 + 6×3 + 1×1 + 5×3
  =   9 +  21 +   8 +   0 +   3 +   0 +   6 +  12 +   0 +  18 +   1 +  15
  = 93
93 / 10 = 9 remainder 3
10 –  3 = 7

```

Thus, the check digit is 7, and the complete sequence is ISBN 978\-0\-306\-40615\-7\.

In general, the ISBN check digit is calculated as follows.

Let

Then

This check system—similar to the [UPC](/wiki/Universal_Product_Code "Universal Product Code") check digit formula—does not catch all errors of adjacent digit transposition. Specifically, if the difference between two adjacent digits is 5, the check digit will not catch their transposition. For instance, the above example allows this situation with the 6 followed by a 1\. The correct order contributes  to the sum; while, if the digits are transposed (1 followed by a 6\), the contribution of those two digits will be . However, 19 and 9 are congruent modulo 10, and so produce the same, final result: both ISBNs will have a check digit of 7\. The ISBN\-10 formula uses the [prime](/wiki/Prime_number "Prime number") modulus 11 which avoids this blind spot, but requires more than the digits 0–9 to express the check digit.

Additionally, if the sum of the 2nd, 4th, 6th, 8th, 10th, and 12th digits is tripled then added to the remaining digits (1st, 3rd, 5th, 7th, 9th, 11th, and 13th), the total will always be divisible by 10 (i.e., end in 0\).


How can the sum of certain digits be used to validate the ISBN-13 check digit?