Contents Show
UPC/PLU Check Digit Calculations are performed and validated during the following processes within the SPIRIT WIC system:
When a new Universal Product Code (UPC) or Price Look-Up (PLU) code record is saved in Add mode on the UPC screen.
When a National UPC File is imported on the Import National UPC File screen.
|
NOTE: A helpful online resource for validating calculated check digits is GS1's Check Digit Calculator. Additionally, GS1's Check_Digit_Calculation.pdf provides for more information related to how check digits are calculated. |
Check digit calculations are performed as outlined in the steps below then you can eliminate length as a factor and apply the same logic consistently to all UPC check digit calculation. The first two steps perform the simplification, and the remaining steps perform the remaining calculations.
1. Ignore the existing check digit if one has been provided.
2. Reverse the UPC/PLU without the check digit.
3. Treating it as a 1-base array, take the value at each odd position and multiple it by 3, then add each of these to a running total.
4. Add all of the even-numbered values to the running total.
5. Take the modulus of the running total. If it is zero, then zero is the check digit. If it's greater than zero, then subtract it from 10 and the resulting value is the check digit.
The examples below capture common Universal Product Code (UPC) formats. Within each example below, the check digits are presented in red text. These examples show how the steps above are computed mathematically for each sample UPC presented, and they also provide samples that can be referenced when validating check digit calculations.
Remove Check Digit: 9505000
Reverse It: 0005059
Odd Digits * 3: (0) + (0) + (0) + (9 * 3) = 27
Even Digits * 1: (0) + (5) + (5) = 10
Sum Totals: 27 + 10 = 37
Mod 10: 37 % 10 = 7
Subtract from 10: = 3
Remove Check Digit: 02068500029
Reverse It: 92000586020
Odd Digits * 3: (9 * 3) + (0) + (0) + (8 * 3) + (0) + (0) = [27 + 24] = 51
Even Digits * 1: (2) + (0) + (5) + (6) + (2) = 15
Sum Totals: 51 + 15 = 66
Mod 10: 66 % 10 = 6
Subtract from 10: = 4
Remove Check Digit: 009492256788
Reverse It: 887652294900
Odd Digits * 3: (8 * 3) + (7 * 3) + (5 * 3) + (2 * 3) + (4 * 3) + (0) = [24 + 21 + 15 + 6 + 12] = 78
Even Digits * 1: (8) + (6) + (2) + (9) + (9) = (0) = 34
Sum Totals: 78 + 34 = 112
Mod 10: 112 % 10 = 2
Subtract from 10: = 8
Remove Check Digit: 0001234560001
Reverse It: 1000654321000
Odd Digits * 3: (1 * 3) + (0) + (6 *3 ) + (4 * 3) + (2 * 3) + (0) + (0) = [3 + 18 + 12 + 6] = 39
Even Digits * 1: (0) + (0) + (5) + (3) + (1) + (0) = 9
Sum Totals: 39 + 9 = 48
Mod 10: 48 % 10 = 8
Subtract from 10: = 2
|
Software Version: 2.40.00