Validation

GS1 check digits for UPC, EAN, and ITF-14 — worked examples

The last digit of a GTIN is not decoration. It is a modulo-10 checksum. One transposed digit in a 200-row CSV will print 200 labels that a register rejects. LabelStack computes the checksum per row and tells you which spreadsheet line is wrong. This page walks the arithmetic so the red row is not a mystery.

LabelStack editors · August 28, 2026 · 14 min read

What the check digit is protecting

UPC-A (12 digits), EAN-13 (13), EAN-8 (8), and ITF-14 (14) all end in a GS1 check digit. The algorithm is the same idea: weight alternating digits by 3 and 1, sum them, and choose a last digit so the total is a multiple of 10. Code 128, Code 39, and Amazon FNSKU do not use this checksum—they have their own character-set and length rules.

If you typed 12 digits for a UPC and the last one is wrong, some generators will happily encode the bad number. A cashier scan then fails or, worse, hits another item. LabelStack compares the digit you entered with the digit the payload requires and flags the row, including the expected digit, so you can fix one cell instead of reprinting the lot.

Worked example: EAN-13 4006381333931

Take the first 12 digits of a well-known confectionery EAN-13: 400638133393. From the right of those 12 (still ignoring the check digit), multiply the last of them by 3, the one before by 1, and so on, alternating 3 and 1 toward the left. Sum those weighted values. The check digit is the number you add to reach the next multiple of 10. For this payload the required check digit is 1, so the full code is 4006381333931.

If someone pastes 4006381333932 (a 2 instead of 1), LabelStack marks that spreadsheet row as invalid and can apply the suggestion 4006381333931. That is the entire point of validating before PDF export: the error is still a cell in a CSV, not a box of unusable stickers. A transposition of two adjacent digits often still fails the check, which is why the algorithm exists. It does not catch every possible typo (two compensating errors can sneak through), so a second look at a new prefix is still worth it.

Worked example: UPC-A 036000291452

UPC-A payload is 11 digits; the 12th is the check. For 03600029145 the same alternating 3-and-1 weighting from the right produces a check digit of 2, so the printed UPC-A is 036000291452. If your sheet shows 036000291453, that last digit is wrong even though the number “looks” like a UPC. LabelStack will name the row and the expected 2.

UPC-E is a compressed UPC-A. The check digit belongs to the expanded 12-digit form, not to a naive 8-digit string. LabelStack expands, checks, and compresses so a pretty compact code is not accepted with a garbage checksum. If a UPC-A will not compress under the zero-suppression rules, keep it as UPC-A. Forcing UPC-E “to make it smaller” on an ineligible number produces bars that do not expand back to the GTIN you think you printed.

EAN-8, ISBN-13, and ITF-14

EAN-8 uses the same modulo-10 idea over 7 payload digits. It is for very small packages and is still a licensed GTIN, not a cute short Code 128. ISBN-13 is EAN-13 with prefix 978 or 979; the same modulo-10 applies. Older ISBN-10 checksums (modulo 11, X allowed) are not GTINs—do not print ISBN-10 as EAN-13 without converting. The ISBN-13 guide on this site walks the conversion at a high level; the check digit on the result is still this algorithm.

ITF-14 is a 14-digit GTIN, often a packaging indicator plus a 12-digit body plus check, used on cases. The check digit is still modulo-10 over the 13 payload digits. A case packer scanning ITF-14 will reject a unit-level UPC even if the numbers “look related.” Put ITF-14 on cartons and UPC/EAN on units.

What LabelStack will not do

It will not invent a GS1 company prefix. It will not register a UPC with GS1 or a reseller. It will not quietly replace your digit without telling you—the row is flagged, and applying the suggestion is an explicit click. If you sell at retail, buy the numbers from GS1 (or a legitimate channel GS1 recognizes). Then encode them here, privately, in bulk.

A valid check digit is necessary and not sufficient. 4006381333931 checks. A random 13-digit string you padded until it checked is still not a GTIN you own. Marketplaces that later match that number to another brand’s catalog will not take “but the generator said it was valid” as a defense.

Keep reading

More original guides

Ready to print? Open the generator. Questions: contact@labelstack.app. Inventory stays in this browser.