Vehicle Identification Numbers (VIN codes)/Check digit
This does not seem to work for Australian VIN numbers.
One element that is fairly consistent in VIN numbers is the use of position 9 as a check digit, compulsory for vehicles in North America and used fairly consistently even outside this rule except in the United Kingdom where the check digit is not used.
Method
[edit | edit source]The process for calculating a VIN check digit is as follows:
- Substitute each letter in the VIN with a digit according to the transliteration table below.
- Multiply each digit in the resulting number with its respective weight according to the table below.
- Sum the resulting products.
- Divide the sum by 11 and take the remainder. This remainder is the check digit. If the remainder is 10, use X as the check digit.
Transliterating the numbers
[edit | edit source]Transliteration consists of of substituting letters with digits according to the table below. I, O and Q are not present in the table because they cannot exist in a valid VIN. Numerical digits use their own values and are not changed by transliteration.
A: 1 | B: 2 | C: 3 | D: 4 | E: 5 | F: 6 | G: 7 | H: 8 | N/A |
J: 1 | K: 2 | L: 3 | M: 4 | N: 5 | N/A | P: 7 | N/A | R: 9 |
S: 2 | T: 3 | U: 4 | V: 5 | W: 6 | X: 7 | Y: 8 | Z: 9 |
Weights used in calculation
[edit | edit source]The following is the weight factor for each position in the VIN. The leftmost digit is position 1. The 9th position is that of the check digit. It has been substituted with a 0, which will cancel it out in the multiplication step.
Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Weight | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 10 | 0 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 |
Worked example
[edit | edit source]Consider the VIN 1M8GDM9A_KP042788
, where the underscore will be the check digit.
VIN | 1 | M | 8 | G | D | M | 9 | A | _ | K | P | 0 | 4 | 2 | 7 | 8 | 8 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transliterated | 1 | 4 | 8 | 7 | 4 | 4 | 9 | 1 | _ | 2 | 7 | 0 | 4 | 2 | 7 | 8 | 8 |
Weights | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 10 | 0 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 |
Products | 8 | 28 | 48 | 35 | 16 | 12 | 18 | 10 | 0 | 18 | 56 | 0 | 24 | 10 | 28 | 24 | 16 |
- Each letter in the VIN is substituted with a digit according to the transliteration table. Digits in the VIN are unchanged. This results in the Transliterated row.
- Each transliterated digit is multiplied with a weight according to the weights table. The weights for each position are reproduced here in the Weights row. Elementwise multiplication results in the Products row.
- The products are summed to 351.
- The sum 351 is divided by 11, yielding a remainder of 10.
- Since the remainder is 10, the check digit is X.
The check digit is added to the VIN: 1M8GDM9AXKP042788
.
The VIN consisting of 11111111111111111
(seventeen 1's) has a valid check digit. This can be used as a test case to verify a check digit algorithm.