Finance calculators

UPC Check Digit Calculator

Updated Sep 16, 2026 By Infinity Calculator
Rate Formulas

GTIN-12 / UPC-A Enter 11 digits Most common

Digits 1–11 of the UPC-A barcode.
Complete number
012345678905
Valid GTIN-12 / UPC-A
Show Calculation Steps — Step-by-Step Solution (GTIN-12)
Weighted contribution of each digit (GTIN-12 row)

GTIN-13 / EAN-13 Enter 12 digits

Digits 1–12 of the EAN-13 barcode.
Complete number
5901234123457
Valid GTIN-13 / EAN-13
Show Calculation Steps — Step-by-Step Solution (GTIN-13)

GTIN-14 Enter 13 digits

Indicator digit plus digits 2–13 of the case/carton code.
Complete number
12345678901231
Valid GTIN-14
Show Calculation Steps — Step-by-Step Solution (GTIN-14)

GTIN-8 Enter 7 digits

Digits 1–7 of the EAN-8 / GTIN-8 barcode.
Complete number
96385074
Valid GTIN-8
Show Calculation Steps — Step-by-Step Solution (GTIN-8)
Recalculates or resets all four format rows at once.

Introduction

Every barcode number ends with one special digit called a check digit. It is not random. It is a small math answer built from all the digits before it. Scanners use it to catch typos. If the last digit does not match the math, the code is wrong and the scan fails.

This UPC Check Digit Calculator works out that digit. Type in your base digits and it returns the check digit. It handles four GS1 formats:

  • GTIN-12 (UPC-A), enter 11 digits. Used on most retail items in the U.S. and Canada.
  • GTIN-13 (EAN-13), enter 12 digits. Used for retail items around the world.
  • GTIN-14, enter 13 digits. Used on cases, cartons, and pallets.
  • GTIN-8 (EAN-8), enter 7 digits. Used on small packs with little label space.

You can also switch any row to Verify mode. Paste a full barcode number and the tool checks if the last digit is correct. It tells you pass or fail, and shows the right digit if it is wrong.

Each row shows the full steps, so you can see the weights, the sum, and the final answer. You can copy the finished number in its normal form or padded to 14 digits for shipping and data files. This helps when you set up new products, fix bad data in a catalog, or check codes before you print labels.

How to use our UPC Check Digit Calculator

Type the digits of your barcode number, and the tool gives you the last digit (the check digit), the full GTIN number, and the math steps behind it.

Calculate or Verify: Pick "Calculate" to find a missing check digit. Pick "Verify" to test if a full number is correct.

GTIN-12 / UPC-A base digits: Enter the first 11 digits of your UPC-A code. This is the most common barcode on retail items in the US.

GTIN-13 / EAN-13 base digits: Enter the first 12 digits of your EAN-13 code. This format is used for retail items around the world.

GTIN-14 base digits: Enter the indicator digit plus the next 12 digits. Use this for cases, cartons, and other shipping packs.

GTIN-8 base digits: Enter the first 7 digits of your EAN-8 code. This short format fits small products.

Full number (Verify mode): Paste the whole barcode number, including the last digit. The tool says Pass or Fail and shows the digit it expected.

Check digit box: This box fills in on its own and cannot be typed in. It shows the one digit you need to add to the end.

Result format buttons: Choose "Original Format" to see your number as is, or "GTIN-14 Format" to see it with zeros added in front for 14 digits.

Copy button: Click it to copy the finished number so you can paste it into your product list or label file.

Calculate and Reset: Use the buttons in a row to work on one format, or use the big Calculate and Reset buttons at the bottom to update or clear all four formats at once.

What Is a UPC Check Digit?

A UPC check digit is the last number in a barcode. It is not random. It is worked out from all the digits before it using a math rule set by GS1, the group that runs barcode standards worldwide. When a scanner reads a barcode, it redoes the math. If the answer does not match the last digit, the scan fails. This stops a wrong product, wrong price, or wrong count from entering your system.

How the Check Digit Math Works

The rule is the same for every GTIN size. Starting from the right side of the base number, digits take turns getting a weight of 3 and a weight of 1. Multiply each digit by its weight, then add all the answers together. Take that total and find what is left over after dividing by 10. Subtract that leftover from 10. If you get 10, the check digit is 0.

Example with UPC-A base digits 01234567890: the weighted total is 45. 45 divided by 10 leaves 5. 10 minus 5 is 5, so the check digit is 5 and the full UPC-A is 012345678905.

The Four GTIN Formats

  • GTIN-12 (UPC-A): 12 digits. The standard retail barcode in the United States and Canada. You enter 11 base digits.
  • GTIN-13 (EAN-13): 13 digits. Used for retail in Europe and most other countries. You enter 12 base digits.
  • GTIN-14: 14 digits. Used on cases, cartons, and pallets. The first digit is an indicator that tells how many units are inside. You enter 13 base digits.
  • GTIN-8 (EAN-8): 8 digits. Used on small items like gum or lip balm where a full barcode will not fit. You enter 7 base digits.

Why GTIN-14 Format Matters

Any GTIN can be written as 14 digits by adding zeros to the front. A UPC-A of 012345678905 becomes 00012345678905. Many warehouse systems, EDI files, and databases store every barcode this way so all records line up in one column. The number itself does not change.

Why This Matters for Business

A bad check digit costs real money. Stores reject shipments with barcodes that will not scan, and some charge chargeback fees for each mistake. Bad numbers also break inventory counts, sales reports, and online listings on sites like Amazon and Walmart. Checking your digit before you print labels is far cheaper than fixing a recalled pallet of goods.

Good Habits to Follow

  • Buy your company prefix from GS1. Made-up barcodes may work in one store but fail everywhere else.
  • Never change the check digit by hand. Always recalculate it if any base digit changes.
  • Keep leading zeros. Dropping them in a spreadsheet is the most common barcode error.
  • Verify every number from a supplier before you load it into your catalog.
  • Give each size, color, and flavor its own GTIN. Do not reuse numbers.

Formulas used

Positional weight (alternating from rightmost base digit)
w_i = \begin{cases} 3, & (n-1-i) \bmod 2 = 0 \\ 1, & \text{otherwise} \end{cases}
Weighted sum of base digits
S = \sum_{i=0}^{n-1} d_i \cdot w_i
GS1 check digit
C = (10 - (S \bmod 10)) \bmod 10
Complete GTIN (base digits with check digit appended)
\text{GTIN} = d_1 d_2 \ldots d_n C
Verification test (supplied vs. calculated check digit)
\text{Valid} \iff C_{\text{supplied}} = (10 - (S \bmod 10)) \bmod 10
GTIN-14 padded format
\text{GTIN-14} = \underbrace{0\,0\,\ldots\,0}_{14 - L} \, \text{GTIN}, \quad L = \text{length}(\text{GTIN})

Frequently asked questions

What is the difference between a UPC and an EAN?

They use the same math and the same barcode family. The size is what changes.

  • UPC-A has 12 digits and is common in the U.S. and Canada.
  • EAN-13 has 13 digits and is used in most other countries.

A UPC-A is really an EAN-13 with a zero in front. Modern scanners read both.

Does adding a zero in front of a UPC change the check digit?

No. Zeros on the left add nothing to the math, because 0 times 3 and 0 times 1 both equal 0. So 012345678905 and 00012345678905 keep the same last digit. That is why any GTIN can be stored as 14 digits without breaking it.

Can a barcode check digit be 0?

Yes. If the weighted total already ends in 0, the leftover is 0 and the check digit is 0. Example: a total of 60 leaves 0, and 10 minus 0 is 10, which becomes 0. A check digit of 0 is normal and correct, so never delete it.

Why does a barcode fail with an invalid check digit error?

The last digit does not match the math for the digits before it. Common causes:

  • A digit was typed wrong or two digits were swapped.
  • A leading zero was dropped by a spreadsheet.
  • Someone edited a base digit but kept the old check digit.
  • An 11-digit number was pasted where 12 were needed.

Recalculate the check digit from the correct base digits and replace the whole number.

Does the check digit catch every typing mistake?

No, but it catches most. It finds 100% of single wrong digits. It misses some swaps of two digits sitting next to each other, like 38 typed as 83, when they differ by 5. That is why you should still read the number back before printing labels.

What do the first digits of a UPC number mean?

The first digit of a UPC-A is the number system digit. 0, 1, 6, 7, 8 and 9 are normal retail items, 2 is store weighted goods like meat, 3 is drugs and health items, 4 is in-store use, and 5 is coupons. After that comes your GS1 company prefix, then your own item number, then the check digit.

How do I get a real UPC barcode for my product?

Apply for a company prefix or a single GTIN from GS1, the group that runs the standard. GS1 gives you the prefix, you add your own item numbers, and you calculate the check digit for each one. Big retailers and marketplaces check that your number traces back to GS1, so cheap resold barcodes often get rejected.

Can two different products have the same UPC?

No. Each size, color, flavor, and pack count needs its own GTIN. If two items share a number, sales reports, stock counts, and prices all mix together. Use a new number whenever the buyer would see the product as different.

Can I reuse a barcode number after a product is discontinued?

Only after a long wait. GS1 rules say you must leave a GTIN unused for at least 48 months after the last item ships before you give it to a new product. Numbers for medical or regulated goods should never be reused.

How does the check digit work on a UPC-E barcode?

UPC-E is a short 8 digit version that drops zeros from a UPC-A. Its check digit is not figured from the short number. You expand UPC-E back to the 12 digit UPC-A, and that number's check digit is the one shown. So the math is always done on the full 12 digits.

Is the check digit part of the printed bars or just the numbers below?

It is inside the bars too. The scanner reads every digit, including the last one, then redoes the math on its own. The numbers printed under the bars are only there so a person can type the code by hand if the scan fails.