Most simple check digit schemes seem to rely on modulo 11 computations or are based on some other factor which is prime relative to the base of the digits. One characteristic of these schemes is that they support detection of one-digit errors and adjacent pair digit exchanges. These are the most frequent manual typing mistakes.
ISBN NumbersThe 10-digit ISBN number contains nine payload digits and one trailing check digit which is computed as follows: First digit is multiplied by 10, second by 9, third by 8 and so on up to the ninth digits which is multiplied by 2. Products are added. Check digit is the difference to the next higher multiple of 11. Difference of 10 is denoted by check digit "X".
Example: ISBN 3-7707-6257-6 has check digit 6.
ISBN digit | Multiplier | Product | |
---|---|---|---|
3 | x 10 | = | 30 |
- | |||
7 | x 9 | = | 63 |
7 | x 8 | = | 56 |
0 | x 7 | = | 0 |
7 | x 6 | = | 42 |
- | |||
6 | x 5 | = | 30 |
2 | x 4 | = | 8 |
5 | x 3 | = | 15 |
7 | x 2 | = | 14 |
- | |||
Sum: | 258 | ||
Next multiple of 11: 24 x 11 | 264 | ||
Check Digit: 264 - 258 | 6 |
Interesting further information including country codes and internal structure for English ISBN block (1st digit is 0 or 1) can be found in the comments of http://www.xfront.com/isbn.xsd.
The serial number on Euro bills conisists of one country character, the payload digits and one check digit. Check digit is negative sum of digits modulo 9 Characters are converted to numbers based on a conversion table (A=11, B=12, C=13, D=14, E=15, F=16, G=17, H=18, I=19, J=20, K=21, L=22, M=23, N=24, O=25, P=26, Q=27, R=28, S=29, T=30, U=31, V=32, W=33, X=34, Y=35, Z=36)
Example: X25277180537 has check digit 7
Example: X = 34; 34 + qs(2527718053) = 34 + 40 = 74; 74 = 8 x 9 + 2; -2 mod 9 = 7.
Last digit is the check digit (0-9). To compute the check digit, iterate the digits from right to left, starting left of the check digit, and multiply with 3 and 1, alternating. Check digit is then set to the difference to next higher multiple of 10. If the product sum is evenly divisible by ten, the check digit is "0".
Example: EAN (EAN-13) 4-007192-578962 has check digit 2.
EAN digit | Multiplier | Product | |
---|---|---|---|
4 | x 1 | = | 4 |
- | |||
0 | x 3 | = | 0 |
0 | x 1 | = | 0 |
7 | x 3 | = | 21 |
1 | x 1 | = | 1 |
9 | x 3 | = | 27 |
2 | x 1 | = | 2 |
- | |||
5 | x 3 | = | 15 |
7 | x 1 | = | 7 |
8 | x 3 | = | 24 |
9 | x 1 | = | 9 |
6 | x 3 | = | 18 |
- | |||
Sum: | 128 | ||
Next multiple of 10: 13 x 10 | 130 | ||
Check Digit: 130 - 128 | 2 |
Last digit is the check digit (0-9). To compute the check digit, iterate the four alphabetic (owner code/product group) characters, then the six numeric digits from left to right. Multiply by 1,2,4,8,...,512, respectively, then compute the sum. Characters are converted to numbers based on a table A=10, B=12, C=13, D=14, .... Z=38. Check digit is then set to the remainder mod 11 (0 for both remainder 0 and 10).
Example: Container number HDMU6105504
has check digit 4.
Character/ Digit |
Value | Multiplier | Product | |
---|---|---|---|---|
H | 18 | x 1 | = | 18 |
D | 14 | x 2 | = | 28 |
M | 24 | x 4 | = | 96 |
U | 32 | x 8 | = | 256 |
6 | 6 | x 16 | = | 96 |
1 | 1 | x 32 | = | 32 |
0 | 0 | x 64 | = | 0 |
5 | 5 | x 128 | = | 320 |
5 | 5 | x 256 | = | 1280 |
0 | 0 | x 512 | = | 0 |
Sum: | 2446 | |||
Next lower multiple of 11: 222 x 11 | 2442 | |||
Check Digit: 2446 - 2442 | 4 |
Back to main page. Back to software page.
This page was last changed on September 10th, 2006. © Matthias Gärtner 2006 |