A check digit is an integral part of a method of error detection. It can refer to one of two things — the actual digit, associated with a multi-digit number, that represents whether that multi-digit number is accurate or not. Alternatively, a check digit refers to the measure used to test the accuracy of a collection or block of data, as opposed to a single number. Either way, the process of this type of redundancy check may be referred to as a check digit calculation or a check digit algorithm. The check digit method can take many different approaches and is used internationally for many different purposes. Some common numbering or coding systems that use check digits include the Universal Product Code (UPC) and the International Standard Book Number (ISBN) among others.
The check digit is designed to catch particular types of errors common in data entry, whether that data was read and entered by the same person on a keyboard or phone keypad, or whether the data was read by one person and entered by another. The most common data entry error in this respect is that of simply entering a single digit incorrectly. This accounts for between 60 and 95 percent of all data errors. Tied for second are omitting or adding a single digit on the one hand, and transposing adjacent digits on the other hand. Other errors that are possible, but occur with far less frequency, include the reversal of the order of three digits so that 123 is entered as 321, for example; and phonetic errors, confusing 16 and 60.
Check digits may actually be added to the the number they are meant to check. In the Vehicle Identification Number (VIN), which has 17 characters, the check digit is in the ninth position. In a 13-digit ISBN number, on the other hand, the check digit appears at the end, as the 13th number.
There are several different algorithms that are commonly used for calculating check digits, and the same algorithm is not always used for the same purpose internationally. For example, the algorithm developed by and named after scientist Hans Peter Luhn, also called Mod 10, is the formula used in the United States for credit and debit card numbers and in Canada for Social Insurance Number (SIN) authentication. The Luhn algorithm is also used for international European Article Number (EAN13) barcodes, while a different formula, Mod11, is used for some barcodes in Germany and for tax filing numbers (TFNs) in Australia.
The Luhn formula tacks the check digit on at the end of the number it verifies. From right to left, including the check digit, each second digit is doubled. If any of the digits that were doubled become multi-digit numbers then the individual numbers of those multi-digit numbers are added together. The remaining numbers are added up. If the resulting sum is divisible by 10, then the multi-digit number is valid according to the Luhn formula. If the resulting sum is not divisible by 10, a check digit that will make the resulting sum divisible by 10 will be added. So, if the number to be validated is 1234, it would not be valid without a check digit of 6 tacked on the end. That's because (1+1) + 2 + (3 + 3) + 4 = 14 which is not divisible by 10. Adding a check digit of 6, however, will make the resulting sum divisible by 10 and therefore valid by the Luhn formula.
In Australia, there was an attempt to use check digits for a second purpose — to limit people’s ability to fake valid numbers for taxation purposes. Despite the government's efforts to keep the check digits algorithm secret, people were able to figure it out and continue to falsify tax-related numbers.