Barcode generator →
home / guides / barcode check digit explained
Barcodes

Barcode Check Digit Explained

The last digit of every EAN or UPC is not part of the product number — it is a checksum computed from the other digits, and it is why a register beeps angrily at a mistyped code instead of charging you for the wrong product.

The Mod-10 algorithm in four steps

For EAN-13, take the first 12 digits. ① Multiply each digit alternately by 1 and 3, starting with 1 at the left. ② Sum all the products. ③ Find the remainder of that sum ÷ 10. ④ The check digit is 10 − remainder (or 0 if the remainder is 0).

Worked example: 590123412345?

Digits 5,9,0,1,2,3,4,1,2,3,4,5 with weights 1,3,1,3…: 5+27+0+3+2+9+4+3+2+9+4+15 = 83. 83 mod 10 = 3, so the check digit is 10 − 3 = 7, giving 5901234123457. Type any single digit wrong and the recomputed checksum almost certainly disagrees — the decoder rejects the scan rather than passing bad data to the till.

What it catches — and what it doesn't

Mod-10 catches all single-digit errors and most adjacent-digit swaps (the classic typing mistakes). It is not cryptographic and not a registration: a number with a valid check digit is merely well-formed, which is why "valid-looking" barcodes from dubious sources can still be unlicensed — the math checks structure, GS1 checks ownership.

You never compute this by hand in practice

Every competent generator does it for you: our barcode generator takes the 12 digits, appends the correct check digit, and — more usefully — when you paste a full 13-digit code with a wrong final digit, it tells you which digit it expected, instantly flagging transcription errors in supplier spreadsheets.

Frequently asked questions

Is the check digit the same for EAN and UPC?
Yes — the same Mod-10 weighting computes the final digit of UPC-A, EAN-13, EAN-8, ITF-14 and GTIN-14. Only the digit count being summed differs.
Can two different products have the same check digit?
Of course — there are only ten possible check digits. The check digit validates a single number's internal consistency; uniqueness comes from GS1's allocation of the underlying digits.
What happens if the check digit is wrong on printed packaging?
Scanners compute the checksum on every read and reject mismatches, so the product simply won't scan — cashiers key it manually and the error eventually surfaces as a costly reprint.

Try it yourself

Related guides