Skip to main content
Guide

How Check Digits Work: The Math Behind GTIN, ISBN and SSCC

GS1 mod-10, ISBN-10 mod-11, and Code 128's mod-103 in plain English — why one trailing digit catches 90% of typos.

By ReadBarcode 6 min read Published 21 May 2026

A supplier sends a spreadsheet of GTINs for a product onboarding. Five hundred rows. Someone copies it into the master data and the import fails on row 247: GTIN reported as invalid. The two rows on either side validate fine. The trailing digit on row 247 is a 1; the supplier insists it should be a 0. Pull up the check-digit calculator and the answer falls out in a second — the rest of the row computes a check digit of 0, the printed 1 is the typo, the supplier needs to fix their feed before re-sending.

That whole exchange exists because of check digits. Every UPC, EAN, GTIN, ISBN, ISSN and SSCC ends in a single trailing digit computed from the rest by a fixed algorithm. The math behind it is small enough to do on paper, the cost is one digit of address space, and the payoff is catching ~90% of the typos that would otherwise propagate quietly through pipelines. This guide unpacks the GS1 mod-10 algorithm in plain English, walks through the ISBN-10 mod-11 variant for completeness, and explains where Code 128's invisible modulo-103 checksum fits.

The short answer

A check digit is the last digit of an identifier, computed from the preceding digits by a fixed formula. UPC-A, EAN-13, GTIN-8/12/13/14, ISBN-13 and SSCC all use the same GS1 mod-10 algorithm. ISBN-10 uses an older mod-11 variant that introduces X as a check character. Code 128 carries an internal modulo-103 checksum that's invisible in the decoded payload — only relevant when you're generating the symbol itself.

GS1 mod-10: the math walkthrough

Take the worked example that runs through this site's guides: GTIN-13 5012345678900. The first twelve digits are the body; the last digit is the check.

  1. Take the body. Strip the trailing check digit, leaving 501234567890.
  2. Read right-to-left, alternating weights of 3 and 1, starting with 3. For 501234567890:
    Body (reversed): 0  9  8  7  6  5  4  3  2  1  0  5
    Weights:         3  1  3  1  3  1  3  1  3  1  3  1
    Products:        0  9 24  7 18  5 12  3  6  1  0  5
    Sum:             0+9+24+7+18+5+12+3+6+1+0+5 = 90
  3. The check digit is whatever brings the sum to the next multiple of 10. 90 is already a multiple of 10, so the check digit is 0. Append to the body and you have the full GTIN-13: 5012345678900.

The calculator runs this same algorithm for any GTIN body — useful when you're minting new identifiers from a fresh company prefix:

Check Digit Calculator

Compute the GS1 mod-10 check digit for any partial UPC, EAN or GTIN body.

Compute for 501234567890

To verify the complete identifier in one step (length class plus check digit) feed it to the validator:

GTIN Validator

Confirm a complete GTIN-8 / 12 / 13 / 14 has the correct mod-10 check digit.

Open with 5012345678900

Why mod-10 catches typos and transpositions

Mod-10 isn't a cryptographic hash — it's a deliberately cheap algorithm that catches the most common human errors with one digit of address-space tax. Two properties make it useful:

  • Every single-digit error is caught. Change any one digit of the body by 1, the sum changes by either 1 or 3, and the resulting check digit moves with it. Mismatch → flagged.
  • Most adjacent transpositions are caught. Swap two neighbouring digits and the sum changes by 2×(difference between them). Whenever that difference is anything other than 0 or 5, the check digit moves and the typo is caught. The blind spot — swapping a 0 and a 5, or a 1 and a 6 — accounts for about 5% of transpositions.

In practice, mod-10 catches the entire class of single-digit typos and the vast majority of transpositions — together that's about 90% of real-world data entry mistakes. The math is from a 1954 paper by Hans Peter Luhn at IBM; the formula has been the GS1 default since GS1 existed.

ISBN-10's mod-11 variant

ISBN-10 — the old ten-digit book identifier — uses a different algorithm. Same spirit (a trailing check digit), different math.

  1. Take the body — the first nine digits of the ISBN-10.
  2. Read left-to-right and multiply each digit by a descending weight starting at 10:
    Body (left-to-right): 0  1  4  3  0  3  3  4  4
    Weights:              10 9  8  7  6  5  4  3  2
    Products:              0  9 32 21  0 15 12 12  8
    Sum:                   0+9+32+21+0+15+12+12+8 = 109
  3. The check digit is whatever brings the sum to the next multiple of 11. 109 → next multiple of 11 is 110, so the check digit is 1. Full ISBN-10: 0143033441.

Most book systems today carry ISBN-13 alongside the legacy ISBN-10; the ISBN reader on this site validates both and surfaces whichever your input started from.

Code 128's modulo-103 checksum

Code 128 (and its GS1-128 cousin) carries an internal checksum that uses modulo-103 — the symbology has 103 codeword positions, so the weights and the modulus both run to that. The checksum is appended as an extra codeword inside the bar pattern; it's never part of the decoded payload.

For most readers and developers, the practical takeaway is short: Code 128 has its own check digit, you don't compute it, you don't see it, and it's why a scratched Code 128 either reads correctly or doesn't read at all. For the spec-level walkthrough of subsets and FNC1, see the Code 128 explained guide.

Common mistakes

  • Recomputing the check digit and overwriting the supplier's value. If the supplied check doesn't match, the right action is to flag the row for human review — not to silently rewrite the digit. The original input might be the source of truth.
  • Using the wrong algorithm. ISBN-10 input fed into a GS1 mod-10 validator returns garbage; an ISBN-13 fed into a mod-11 validator does the same. Route inputs to the correct algorithm based on length and prefix.
  • Storing the check digit separately from the body. Some legacy systems split GTIN into "body" and "check" columns. That makes it too easy to re-concatenate them in the wrong order. Store the complete identifier as a single string.
  • Skipping validation on internal SKUs. If your internal codes happen to be 12 or 13 digits, they'll look like GTINs but won't validate. Either give them an obviously non-GTIN format, or add a check digit of your own.
  • Assuming a valid check digit means the GTIN exists. Mod-10 checks the math; it doesn't confirm the identifier was issued to a real company by GS1. For ownership verification you need GS1 Verified-by-GS1, not a local check.

Frequently asked

What's a check digit, in plain English?

It's an extra digit at the end of an identifier — UPC, EAN, GTIN, ISBN, SSCC — that's computed from the other digits using a fixed formula. If the rest of the number gets typed wrong, the computed value won't match the printed one, and the system flags the input as invalid before it does any damage.

Is the check digit the same algorithm for UPC, EAN, GTIN and ISBN-13?

Yes for the four most common cases. UPC-A, EAN-13, GTIN-8/12/13/14, ISBN-13 and SSCC all use the GS1 mod-10 algorithm. ISBN-10 is the odd one out — it uses a separate mod-11 algorithm with X as a possible check character. Code 128 has its own internal modulo-103 checksum that's invisible in the decoded string.

What kinds of typos does mod-10 catch?

Every single-digit error (one digit typed wrong) is guaranteed to be caught. Most adjacent-digit transpositions (swapping two neighbouring digits) are caught too — except a handful of specific pairs like 0↔9 where the weighting cancels out. Together that covers roughly 90% of real-world data entry errors with one extra digit of address space.

Why does ISBN-10 use a different algorithm?

ISBN-10 predates GS1 mod-10 by a few years and was designed when libraries used base-11 arithmetic (which catches a few more error classes than base-10). When ISBN-13 was introduced in 2007, the publishing industry standardised on the GS1 mod-10 already used everywhere else, so any new ISBN minted today uses the EAN-13 algorithm.

Where does the X in some ISBN-10s come from?

It's the check character for the number 10 — mod-11 can produce a remainder of 10, which doesn't fit in a single decimal digit. The convention is to write X (the Roman numeral) instead. You'll only see X at the very end of an ISBN-10, never anywhere else.

Does Code 128's check digit appear in the decoded string?

No. Code 128's modulo-103 checksum is part of the symbol's internal structure, not the encoded payload. The scanner verifies it during decoding and either returns the plain payload or an error — your software sees clean text either way. Only the symbol designer needs to think about modulo-103.

References

  • GS1 General Specifications — defines the mod-10 algorithm for every GS1 identifier. Published by GS1 and updated annually.
  • ISO 2108 (ISBN) — the international standard that defines ISBN-10 (mod-11) and ISBN-13 (GS1 mod-10). Available from the ISO catalogue.
  • ISO/IEC 15417 (Code 128) — defines the modulo-103 checksum and the symbol's internal structure: iso.org/standard/43896.

The fast path: paste a body into the Check Digit Calculator to compute the correct trailing digit, or a full identifier into the GTIN Validator to confirm the printed one matches.

Next read

More guides