# Check digit

A check digit is a form of redundancy check used for error detection, the decimal equivalent of a binary checksum. It consists of a single digit computed from the other digits in the message.

The final digit of a Universal Product Code is a check digit computed so that summing the even-numbered digits, plus 3 times the odd-numbered digits, modulo 10, is 0. For example, take the UPC 070617006092. The sum of even numbered digits is 7+6+7+0+0+2 = 22, and the sum of the odd-numbered digits is 0+0+1+0+6+9 = 16. The total sum is 22+3×16 = 70 ≡ 0 modulo 10. So the code is valid.

The final character of an International Standard Book Number is a check digit computed so that multiplying each digit by its position in the number (counting from the right) and taking the sum of these products modulo 11, is 0. The last digit (which is multiplied by 1) is the check digit, chosen to make the sum correct. It may need to have the value 10, which is represented as the letter X. For example, take the ISBN 0201530821. The sum of products is 0×10 + 2×9 + 0×8 + 1×7 + 5×6 + 3×5 + 0×4 + 8×3 + 2×2 + 1×1 = 99 ≡ 0 modulo 11. So the ISBN number is valid.

While this may seem more complicated than the first scheme, it can actually computed very simply using two sums, both initialized to 0:

```sum1 = sum2 = 0
for (each digit of the ISBN)
sum1 = sum1 + digit
sum2 = sum2 + sum1
```

the final sum2 should be a multiple of 11.

### Other examples of check digits

Compare to check bit.

• Art and Cultures
• Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
• Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
• Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
• United States (http://www.academickids.com/encyclopedia/index.php/United_States)
• World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
• Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
• Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
• Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
• Space and Astronomy
• Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)