UPC Check Digit Calculator
UPC-A code
- The UPC check digit protects the other eleven digits: in 0 36000 29145 the digits in odd positions (1st, 3rd, 5th...) are weighted by 3 and the even positions by 1.
- The weighted sum is 58, and the check digit is the number that brings the total to a multiple of ten: (10 - 58 mod 10) mod 10 = 2.
- The complete UPC-A code is 0 36000 29145 2, with the check digit 2 printed as the last digit of the barcode.
- A scanner that reads a code whose check digit fails knows the scan was misread; the scheme catches every single-digit error and most transpositions, which is why it survives on nearly every retail product.
This UPC check digit calculator turns the first 11 digits of a UPC-A code into the 12th digit and tells you whether a full 12-digit code is valid. The check digit is chosen so that the weighted digit sum, odd positions times 3 plus even positions times 1, is a multiple of 10. For the classic example digits 0 36000 29145, the weighted sum is 58 and the check digit is 2. The full code 0 36000 29145 2 validates, because its first 11 digits again give the check digit 2. As another example, for the digits 1 23456 78905 the weighted sum is 110 and the check digit is 0. Leading zeros matter: numeric entry drops them, so this calculator restores an 11 digit entry starting with 0 automatically.
The weighted-sum method is the accepted standard for UPC-A check digits because it is simple to compute and catches most common entry mistakes. The checksum catches every single-digit error and most adjacent transpositions, but not every swapped pair. This page shows the formula, step-by-step workings, worked examples and sources so you can follow each step and check the result yourself.
Worked examples
Compute the check digit
(Compute the check digit (enter 11 digits) · 3600029145)
| UPC-A check digit | 2 |
| Full 12-digit UPC-A | 0 36000 29145 2 |
| Weighted digit sum | 58 |
| Check digit rule | (10 - sum mod 10) mod 10 |
| Digits entered | 0 36000 29145 |
Validate a full code
(Validate a full code (enter 12 digits) · 36000291452)
| UPC-A validity | Valid |
| Expected check digit | 2 |
| Check digit in the code | 2 |
| Weighted digit sum (first 11 digits) | 58 |
| Code checked | 0 36000 29145 2 |
Compute another check digit
(Compute the check digit (enter 11 digits) · 12345678905)
| UPC-A check digit | 0 |
| Full 12-digit UPC-A | 1 23456 78905 0 |
| Weighted digit sum | 110 |
| Check digit rule | (10 - sum mod 10) mod 10 |
| Digits entered | 1 23456 78905 |
Why barcodes carry a check digit
At a checkout, a barcode is read in a fraction of a second by a beam of light sweeping across a pattern of dark and light bars. That speed is the point, but it also means a smudged label, a curved package, or a cheap handheld scanner can turn a bar into the wrong width and hand the till a number that was never printed on the product. Without a safeguard, the wrong price would ring up or the wrong item would be logged in inventory, and nobody would notice until a customer or an accountant complained.
The UPC-A check digit is that safeguard. The last digit of a UPC-A code is not part of the product number; it is computed from the other eleven digits. The rule is a weighted sum: multiply the digits in odd positions by 3, multiply the digits in even positions by 1, add everything together, and choose the check digit so the total lands on a multiple of 10. Take the classic example digits 0 36000 29145. The weighted sum of those eleven digits is 58, so the check digit must be 2 to bring the total to 60. The full code 0 36000 29145 2 validates, because its first 11 digits again give the check digit 2. A different set, 1 23456 78905, has a weighted sum of 110, so its check digit is 0.
This turns every UPC-A into a self-checking number. The scanner reads all twelve digits, recomputes the check digit from the first eleven, and compares. If a bar was misread, the recomputed digit will almost certainly disagree with the printed one, and the scanner rejects the read instantly instead of sending a bad number to the till. The clerk simply scans again. That is why a upc check digit calculator is useful for anyone building or verifying labels by hand: it applies the same arithmetic the scanner does, so a code can be tested before it ever reaches a shelf.
The check is strong but not perfect. The checksum catches every single-digit error, since changing one digit shifts the weighted sum by a value that cannot stay a multiple of 10. It also catches most adjacent transpositions, though not every swapped pair, because some neighboring digits carry the same weight and trade places without disturbing the total. The check digit is a fast filter, not a guarantee, which is why scanners and store systems still rely on price lookups and human eyes for the rare case that slips through.
One practical wrinkle: leading zeros matter. A UPC-A can begin with 0, and if you type the digits into a spreadsheet or a numeric field, that zero silently disappears, leaving an 11-digit entry that no longer matches the printed code. This calculator restores an 11-digit entry starting with 0 automatically, so the arithmetic runs on the digits that are actually on the package.
The 3-1 weighting algorithm
The UPC-A check digit is not an arbitrary final character. It is chosen so that a weighted digit sum lands on a multiple of 10. The weighting is simple: digits in odd positions are multiplied by 3, and digits in even positions are multiplied by 1. Add those products together, and the check digit is whatever value makes the total a multiple of 10. This is the rule a upc check digit calculator applies, and it is worth walking through by hand once so the result stops looking like magic.
Take the classic example digits 0 36000 29145. Counting from the left, the odd positions hold 0, 6, 0, 2, 1 and 5, and the even positions hold 3, 0, 0, 9 and 4. Multiply the odd-position digits by 3: 0, 18, 0, 6, 3 and 15, which add up to 42. Multiply the even-position digits by 1: 3, 0, 0, 9 and 4, which add up to 16. The weighted sum is 42 plus 16, or 58. The next multiple of 10 above 58 is 60, so the check digit is 60 minus 58, which is 2. That gives the full code 0 36000 29145 2.
The full code validates because the rule is self-checking. Run the first 11 digits through the same 3-1 weighting again and you get the same weighted sum of 58, which again calls for a check digit of 2. The final digit agrees with the calculation, so the code passes. A second example confirms the pattern: for the digits 1 23456 78905, the weighted sum is 110, which is already a multiple of 10, so the check digit is 0.
One practical trap is the leading zero. The example above begins with 0, and numeric entry routinely drops it, leaving a 10-digit string that no longer lines up with the odd and even positions. That is why this calculator restores an 11-digit entry starting with 0 automatically, so the weighting is applied to the digits as printed rather than as a spreadsheet or form field stored them.
The checksum is a useful guard, not a guarantee. It catches every single-digit error, and it catches most adjacent transpositions, but not every swapped pair. A code that passes the weighted sum is well formed, yet it can still be a valid number for the wrong product if the digits were misread in a way the weighting cannot detect.
- Odd positions: multiply by 3. For 0 36000 29145 the odd digits give 0 + 18 + 0 + 6 + 3 + 15 = 42.
- Even positions: multiply by 1. The even digits give 3 + 0 + 0 + 9 + 4 = 16.
- Weighted sum: 42 + 16 = 58. The next multiple of 10 is 60, so the check digit is 2.
- Validation: the first 11 digits of 0 36000 29145 2 give 58 again, confirming the check digit 2.
- Second example: 1 23456 78905 gives a weighted sum of 110, so the check digit is 0.
Compute versus validate modes
A UPC check digit calculator works in one of two modes depending on how many digits you enter. If you type 11 digits, the tool computes the check digit for you: it applies the UPC-A rule and returns the single digit that completes the code. If you type all 12 digits, it switches to validation and tells you whether the printed code you have in hand is correct. The mode is set by the length of your input, so there is no setting to toggle — just enter the digits you have and read the result.
The rule behind both modes is the same. The UPC-A check digit is chosen so that the weighted digit sum — odd positions times 3 plus even positions times 1 — is a multiple of 10. In the classic example with digits 0 36000 29145, the weighted sum is 58, so the check digit is 2, bringing the total to 60. The full code 0 36000 29145 2 validates because its first 11 digits again give the check digit 2. A second example shows the same logic with a different result: for the digits 1 23456 78905 the weighted sum is 110, so the check digit is 0.
Leading zeros need special handling in both modes. Many spreadsheets and entry fields treat a code as a number, and numeric entry drops leading zeros. To keep the result correct, this calculator restores an 11 digit entry starting with 0 automatically. That means you can paste or type the digits without worrying that the first zero was silently removed — the tool puts it back before running the calculation.
Validation is useful when you are checking a code someone else produced, such as a label, a barcode proof or a list from a supplier. Computation is the mode to use when you are building a code and need the final digit. In either case, the check digit is a detection tool, not a guarantee. The checksum catches every single-digit error and most adjacent transpositions, but not every swapped pair, so a code that validates can still contain certain mistakes.
- Enter 11 digits to compute the UPC-A check digit.
- Enter 12 digits to validate a printed code against its first 11 digits.
- An 11 digit entry starting with 0 is restored automatically, so leading zeros are not lost.
What a valid code does and does not prove
A passing check digit is a statement about the digits themselves, not about the product. The UPC-A check digit is chosen so the weighted digit sum — odd positions times 3 plus even positions times 1 — is a multiple of 10. That is a math rule applied to the number, and it can be satisfied by any 11 starting digits whatsoever. The check digit is a guard against typing and scanning mistakes, not a certificate that the code belongs to a real item on a real shelf.
The classic example shows how narrow that guarantee is. For the digits 0 36000 29145 the weighted sum is 58 and the check digit is 2, so the full code 0 36000 29145 2 validates, because its first 11 digits again give the check digit 2. Likewise, for the digits 1 23456 78905 the weighted sum is 110 and the check digit is 0. Both codes pass the same arithmetic test. Nothing in that test knows whether either number was ever issued to a manufacturer or assigned to a product.
What the checksum does catch is worth knowing. It catches every single-digit error, and it catches most adjacent transpositions — but not every swapped pair. So a scanner beep or a green checkmark on a upc check digit calculator tells you the digits are internally consistent. It does not tell you the item is genuine, in stock, or correctly priced.
Registration is a separate matter entirely. Whether a number is actually assigned to a real product lives in GS1's database, not in the check digit. A code can pass the arithmetic and still be unregistered, retired, or simply made up. To confirm what a number refers to, look it up in GS1's records rather than trusting the checksum alone.
One practical wrinkle: leading zeros matter. Numeric entry drops them, so this calculator restores an 11 digit entry starting with 0 automatically. Without that step, an 11 digit string typed without its leading zero would be shifted by one position, the weighted sum would change, and a perfectly valid code could appear to fail — a reminder that the check digit is only ever as meaningful as the digits you actually enter.
FAQs
What is the check digit for 0 36000 29145?
The check digit is 2. Multiply the digits in odd positions by 3 and add the even-position digits, and the weighted sum comes to 58. Adding 2 brings that total to 60, which is a multiple of 10. So the complete 12-digit UPC-A code ends in 2.
How is the UPC check digit calculated?
Multiply the digits in odd positions by 3, then add the even-position digits. Take the number that brings that total up to the next multiple of 10. That final number is the check digit. The calculator applies this method to the 11 digits you enter and returns the 12th digit.
Why did my code starting with 0 fail to enter?
Number fields drop leading zeros, so a UPC that begins with 0 can lose that digit when typed into a numeric box. This calculator pads the entry back to 11 digits, so a code entered without its leading zero is still handled correctly and produces the right check digit.
Does a valid check digit mean the product is genuine?
No. A valid check digit proves only that the digits are internally consistent. Counterfeit products can copy a valid code, so a passing checksum does not confirm authenticity. Registration is checked with GS1, the organization that issues and tracks product codes.
What errors does the checksum miss?
The checksum catches all single-digit errors and most transpositions. However, swaps of digits differing by 5 in weighted positions can pass undetected, because the weighted difference falls on a multiple of 10. So a valid check digit is strong protection, but not perfect.
Is UPC the same as EAN-13?
No, but they are closely related. UPC-A is the 12-digit North American form. EAN-13 adds a leading country digit to make 13 digits. A UPC code is effectively an EAN with a leading 0, so the two formats share the same underlying structure.