# Check digit

> A check digit is the last number in a barcode. It is calculated from the others, so a scanner can tell when a digit has been read wrong.

- Source: https://storestandards.com/glossary/check-digit/
- Updated: 2026-08-14
- Author: Tom Beckwith, Engineer, Store Standards

---

It is not part of the product code. It is a test.

## How it works

Take the first twelve digits of an [EAN](https://storestandards.com/glossary/ean/). Multiply every
second one by three, add them all up, and see how far the total is from the
next multiple of ten. That gap is the check digit.

A scanner does the same sum in a few thousandths of a second. If the answer
does not match the digit it read, it refuses the scan rather than giving you
the wrong product.

## Why you meet it

Mostly when a number will not go in. You typed thirteen digits from a supplier
sheet, Shopify took them, and the scanner never finds them.

One digit is wrong. Often two digits are swapped, which is the exact fault the
check digit was invented to catch.

## Where it goes wrong

People generate their own barcode numbers and leave the last digit off, or
pick one at random. The number looks fine and every proper scanner rejects it.

If you need your own codes, use [Code 128](https://storestandards.com/glossary/code-128/), which does
not need a check digit at all. If you need a real
[GTIN](https://storestandards.com/glossary/gtin/), it comes with the correct check digit already on the
end, and you should never change it.

## Related terms

- [EAN](https://storestandards.com/glossary/ean/): An EAN is the thirteen-digit retail barcode used across Europe and most of the world outside North America.
- [UPC](https://storestandards.com/glossary/upc/): A UPC is the twelve-digit retail barcode used in the United States and Canada. It is the North American cousin of the EAN.
- [GTIN](https://storestandards.com/glossary/gtin/): A GTIN is the number that identifies a product worldwide. The barcode on the box is just a way of printing it.