A
check digit is a form of redundancy check used for
error detection, the decimal equivalent of a binary
check bit. It consists of a single digit computed from the other digits in the number. The method for the 10-digit ISBN is an extension of that for SBNs, so the two systems are compatible; an SBN prefixed with a zero (the 10-digit ISBN) will give the same check digit as the SBN without the zero. The check digit is base eleven, and can be an integer between 0 and 9, or an 'X'. The system for 13-digit ISBNs is not compatible with SBNs and will, in general, give a different check digit from the corresponding 10-digit ISBN, so does not provide the same protection against transposition. This is because the 13-digit code was required to be compatible with the
EAN format, and hence could not contain the letter 'X'.
ISBN-10 check digits According to the 2001 edition of the International ISBN Agency's official user manual, the ISBN-10 check digit (which is the last digit of the 10-digit ISBN) must range from 0 to 10 (the symbol 'X' is used for 10), and must be such that the sum of the ten digits, each multiplied by its (integer) weight, descending from 10 to 1, is a multiple of 11. That is, if is the th digit (numbering from left to right), then must be chosen such that: {{block indent|\sum_{i = 1}^{10} (11-i)x_i \equiv 0 \pmod{11}.}} For example, for an ISBN-10 of 0-306-40615-2: {{block indent| \begin{align} s &= (0\times 10) + (3\times 9) + (0\times 8) + (6\times 7) + (4\times 6) + (0\times 5) + (6\times 4) + (1\times 3) + (5\times 2) + (2\times 1) \\ &= 0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 + 2\\ &= 132 = 12\times 11. \end{align} }} Formally, using
modular arithmetic, this is rendered {{block indent|(10x_1+9x_2+8x_3+7x_4+6x_5+5x_6+4x_7+3x_8+2x_9+x_{10})\equiv 0 \pmod{11}.}} It is also true for ISBN 10s that the sum of all ten digits, each multiplied by its weight in
ascending order from 1 to 10, is a multiple of 11. For this example: {{block indent| \begin{align} s &= (0\times 1) + (3\times 2) + (0\times 3) + (6\times 4) + (4\times 5) + (0\times 6) + (6\times 7) + (1\times 8) + (5\times 9) + (2\times 10) \\ &= 0 + 6 + 0 + 24 + 20 + 0 + 42 + 8 + 45 + 20\\ &= 165 = 15\times 11. \end{align} }} Formally, this is rendered {{block indent|(x_1 + 2x_2 + 3x_3 + 4x_4 + 5x_5 + 6x_6 + 7x_7 + 8x_8 + 9x_9 + 10x_{10})\equiv 0 \pmod{11}.}} The two most common errors in handling an ISBN (e.g. when typing it or writing it down) are a single altered digit or the transposition of adjacent digits. It can be proven mathematically that all pairs of valid ISBN 10s differ in at least two digits. It can also be proven that there are no pairs of valid ISBN 10s with eight identical digits and two transposed digits (these proofs are true because the ISBN is less than eleven digits long and because 11 is a
prime number). The ISBN check digit method therefore ensures that it will always be possible to detect these two most common types of error, i.e., if either of these types of error has occurred, the result will never be a valid ISBN—the sum of the digits multiplied by their weights will never be a multiple of 11. However, if the error were to occur in the publishing house and remain undetected, the book would be issued with an invalid ISBN. In contrast, it is possible for other types of error, such as two altered non-transposed digits, or three altered digits, to result in a valid ISBN (although it is still unlikely).
ISBN-10 check digit calculation Each of the first nine digits of the 10-digit ISBN—excluding the check digit itself—is multiplied by its (integer) weight, descending from 10 to 2, and the sum of these nine products found. The value of the check digit is simply the one number between 0 and 10 which, when added to this sum, means the total is a multiple of 11. For example, the check digit for an ISBN-10 of 0-306-40615-
? is calculated as follows: {{block indent| \begin{align} s &= (0\times 10)+(3\times 9)+(0\times 8)+(6\times 7)+(4\times 6)+(0\times 5)+(6\times 4)+(1\times 3)+(5\times 2)\\ &= 130. \end{align} }} Adding 2 to 130 gives a multiple of 11 (because 132 = 12×11)—this is the only number between 0 and 10 which does so. Therefore, the check digit has to be 2, and the complete sequence is ISBN 0-306-40615-2. If the value of x_{10} required to satisfy this condition is 10, then an 'X' should be used. Alternatively,
modular arithmetic is convenient for calculating the check digit using modulus 11. The
remainder of this sum when it is divided by 11 (i.e. its value modulo 11), is computed. This remainder plus the check digit must equal either 0 or 11. Therefore, the check digit is (11 minus the remainder of the sum of the products modulo 11) modulo 11. Taking the remainder modulo 11 a second time accounts for the possibility that the first remainder is 0. Without the second modulo operation, the calculation could result in a check digit value of , which is invalid. (Strictly speaking, the
first "modulo 11" is not needed, but it may be considered to simplify the calculation.) For example, the check digit for the ISBN of 0-306-40615-
? is calculated as follows: {{block indent| \begin{align} s &= (11 - ( ( (0\times 10)+(3\times 9)+(0\times 8)+(6\times 7)+(4\times 6)+(0\times 5)+(6\times 4)+(1\times 3)+(5\times 2) ) \,\bmod\, 11 ) ) \,\bmod\, 11\\ &= (11 - ( (0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 ) \,\bmod\, 11) ) \,\bmod\, 11\\ &= (11-((130) \,\bmod\, 11))\,\bmod\, 11 \\ &= (11-(9))\,\bmod\, 11 \\ &= 2\,\bmod\, 11 \\ &= 2 \end{align} }} Thus the check digit is 2. It is possible to avoid the multiplications in a software implementation by using two accumulators. Repeatedly adding t into s computes the necessary multiples: // Returns ISBN error syndrome, zero for a valid ISBN, non-zero for an invalid one. // digits[i] must be between 0 and 10. int CheckISBN(int const digits[10]) { int i, s = 0, t = 0; for (i = 0; i The modular reduction can be done once at the end, as shown above (in which case s could hold a value as large as 496, for the invalid ISBN 99999-999-9-X), or s and t could be reduced by a conditional subtract after each addition.
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. As ISBN-13 is a subset of
EAN-13, the algorithm for calculating the check digit is exactly the same for both. Formally, using
modular arithmetic, this is rendered: {{block indent|(x_1 + 3x_2 + x_3 + 3x_4 + x_5 + 3x_6 + x_7 + 3x_8 + x_9 + 3x_{10} + x_{11} + 3x_{12} + x_{13} ) \equiv 0 \pmod{10}.}} 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 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: \textstyle \begin{array}{rlllllllllllll} s &{}= 1 \times 9 &{}+ 3 \times 7 &{}+ 1 \times 8 &{}+ 3 \times 0 &{}+ 1 \times 3 &{}+ 3 \times 0 &{}+ 1 \times 6 &{}+ 3 \times 4 &{}+ 1 \times 0 &{}+ 3 \times 6 &{}+ 1 \times 1 &{}+ 3 \times 5 \\ &{}= 9 &{}+21 &{}+ 8 &{}+ 0 &{}+ 3 &{}+ 0 &{}+ 6 &{}+ 12 &{}+ 0 &{}+ 18 &{}+ 1 &{}+ 15 \\ &{}= 93 \end{array} --> 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 {{block indent|r = 10 - \big(\big(x_1 + 3x_2 + x_3 + 3x_4 + \cdots + x_{11} + 3x_{12}\big) \bmod 10\big).}} Then {{block indent| x_{13} = \begin{cases} r, & r }} This check system—similar to the
UPC 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 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).
ISBN-10 to ISBN-13 conversion A 10-digit ISBN is converted to a 13-digit ISBN by prepending "978" to the ISBN-10 and recalculating the final checksum digit using the ISBN-13 algorithm. The reverse process can also be performed, but not for numbers commencing with a prefix other than 978, which have no 10-digit equivalent.
Errors in usage Publishers and
libraries have varied policies about the use of the ISBN check digit. Publishers sometimes fail to check the correspondence of a book title and its ISBN before publishing it; that failure causes book identification problems for libraries, booksellers, and readers. For example, is shared by two books—
Ninja gaiden: a novel based on the best-selling game by Tecmo (1990) and
Wacky laws (1997), both published by
Scholastic. Most libraries and booksellers display the book record for an invalid ISBN issued by the publisher. The Library of Congress catalogue contains books published with invalid ISBNs, which it usually tags with the phrase "Cancelled ISBN". The International Union Library Catalog (
WorldCat OCLC—Online Computer Library Center system) often indexes by invalid ISBNs, if the book is indexed in that way by a member library. == EAN format used in barcodes, and upgrading ==