Check Digit
Check Digit
A check digit is the final digit included in a code; it is calculated from all the
other digits in the code. Check digits are used for barcodes on products, such
as International Standard Book Numbers (ISBN) and Vehicle Identification
Numbers.
(VIN). Check digits are used to identify errors in data entry caused by mis-
typing or mis scanning a barcode. They can usually detect the following
types of error:
» an incorrect digit entered, for example 5327 entered instead of 5307
» transposition errors where two numbers have changed order, for example
5037 instead of 5307
» omitted or extra digits, for example 537 instead of 5307 or 53107 instead
of 5307
» phonetic errors, for example 13 (thirteen), instead of 30 (thirty).
There are a number of different methods used to generate a check digit. Two
common methods will be considered here:
» ISBN 13
» Modulo-11
The check digit in ISBN 13 is the thirteenth digit in the number. We will now consider two
different calculations. The first calculation is the generation of the check digit.
The second calculation is a verification of the check digit (that is, a recalculation).
Calculation 1 – Generation of the check digit from the other 12 digits in a number
The following algorithm generates the check digit from the 12 other digits:
1 add all the odd numbered digits together
2 add all the even numbered digits together and multiply the result by 3
3 add the results from 1 and 2 together and divide by 10
4 take the remainder, if it is zero then use this value, otherwise subtract the remainder from
10 to find the check digit.