TOPICS
Search

Check Digit


A check digit is a checksum represented by one symbol and included in an identifier to help detect errors. It is calculated from the data digits, rather than carrying independent identification information. Examples occur in UPC and ISBN.

For a common decimal scheme, let d_1,...,d_n be the data digits, indexed from right to left. Set w_i=3 when i is odd and w_i=1 when i is even. The check digit appended on the right is

 c=(-sum_(i=1)^nw_id_i) (mod 10),

where a (mod m) denotes the common residue of a modulo m. Thus, 0<=c<=9 and c+sum_(i=1)^(n)w_id_i is divisible by 10 (GS1).

Since 1 and 3 are relatively prime to 10, changing any single digit, including c, makes c+sum_(i=1)^(n)w_id_i no longer divisible by 10. However, swapping adjacent unequal digits leaves this sum unchanged modulo 10 iff their values differ by 5. A successful check therefore does not guarantee that the identifier is free of errors.


See also

Checksum, Coding Theory, ISBN, UPC

Explore with Wolfram|Alpha

References

GS1. "How to Calculate a Check Digit Manually." https://www.gs1.org/services/how-calculate-check-digit-manually.Numberphile. "11.11.11." Nov. 8, 2011. https://www.youtube.com/watch?v=sPFWfAxIiwg.

Cite this as:

Weisstein, Eric W. "Check Digit." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/CheckDigit.html

Subject classifications