What Is a Check Digit?

A check digit is a single digit appended to a code to detect transcription errors. It's calculated from the preceding digits using a mathematical formula, enabling automated validation systems to catch common mistakes: transposed digits, dropped digits, or accidental insertions.

Check digits appear throughout global commerce and finance. You'll find them in:

  • Bank account numbers and wire transfers
  • ISBN and ISSN publication identifiers
  • Credit card numbers (Luhn algorithm)
  • Product barcodes under GS1 standards
  • International shipping container codes

When a barcode is scanned, the system recalculates the check digit from the first digits. If the result doesn't match the final digit, the scan is rejected—preventing mislabeled items from entering stock.

Understanding GTIN Standards

GTIN—Global Trade Item Number—is the universal standard for product identification, maintained by GS1 (the international standards organization). Different GTIN formats serve different supply chain tiers:

  • GTIN-8 (EAN-8): 7 digits + check digit; compact format for small items
  • GTIN-12 (UPC-A): 11 digits + check digit; dominant in North American retail
  • GTIN-13 (EAN-13): 12 digits + check digit; standard across Europe, Asia, and most international markets
  • GTIN-14 (ITF-14): 13 digits + check digit; identifies shipping cases and multipacks
  • GSIN: 16 digits + check digit; tracks shipments globally
  • SSCC: 17 digits + check digit; identifies individual shipping containers

Each format includes a country code (the first 2–3 digits), identifying where the manufacturer is registered—not necessarily where the product originates.

The Modulo 10 Check Digit Algorithm

The check digit is calculated by weighting alternate positions, summing results, and deriving the final digit from the nearest multiple of 10. Here's the procedure:

Step 1: Sum all digits in even positions and multiply by 3

Even Sum = (d₂ + d₄ + d₆ + ...) × 3

Step 2: Sum all digits in odd positions

Odd Sum = d₁ + d₃ + d₅ + ...

Step 3: Add the two sums

Total = Even Sum + Odd Sum

Step 4: Subtract from the next highest multiple of 10

Check Digit = 10 − (Total mod 10)

If result = 10, use 0

  • d₁, d₂, d₃... — Individual digits of the code (numbered from left to right)
  • Even Sum — Product of 3 and the sum of digits at even positions (2, 4, 6, etc.)
  • Odd Sum — Sum of digits at odd positions (1, 3, 5, etc.)
  • Check Digit — The final digit computed to validate the complete barcode

Common Pitfalls When Calculating or Verifying Check Digits

Avoid these frequent mistakes when working with GTIN codes:

  1. Confusing position numbering — Positions are always counted left-to-right, starting at 1. The check digit itself is never included in the calculation—only the preceding digits factor into the formula. Double-check whether your code includes leading zeros; they count as valid digits.
  2. Using the wrong format — GTIN-12 and GTIN-13 have different position weights because they're different lengths. Always identify your barcode type first (usually printed alongside the barcode or in your product master data) before calculating. A misidentified format will yield an incorrect check digit every time.
  3. Forgetting leading zeros in calculations — Zeros at the start of a code are mathematically active—they contribute to the weighted sum. Many calculators or manual entries strip leading zeros, causing validation failures downstream. Preserve all digits, especially when copying codes between systems.
  4. Assuming one algorithm works everywhere — While GS1 uses modulo 10 consistently, ISBN uses modulo 11, and credit cards use Luhn (a variant). Verify which algorithm applies to your identifier type before coding or troubleshooting verification failures.

Step-by-Step Example: GTIN-12 Barcode

Let's calculate the check digit for the code 11234556780 (11 digits; GTIN-12 format):

Step 1: Identify even-position digits (2, 4, 6, 8, 10)

Positions: 1 2 3 4 5 6 7 8 9 10 11
Digits: 1 1 2 3 4 5 5 6 7 8 0
Even: 1 3 5 6 8

Even Sum = 1 + 3 + 5 + 6 + 8 = 23
Multiply by 3: 23 × 3 = 69

Step 2: Sum odd-position digits (1, 3, 5, 7, 9, 11)

Odd digits: 1, 2, 4, 5, 7, 0

Odd Sum = 1 + 2 + 4 + 5 + 7 + 0 = 19

Step 3: Add the sums

Total = 69 + 19 = 88

Step 4: Calculate check digit

Next multiple of 10 = 90
Check Digit = 90 − 88 = 2

Complete GTIN-12: 112345567802

Frequently Asked Questions

How do I know if my barcode is GTIN-8, GTIN-12, or GTIN-13?

Count the total digits in the barcode, including the final check digit. GTIN-8 has 8 digits, GTIN-12 has 12, and GTIN-13 has 13. Your product documentation or point-of-sale system should also indicate the standard. Most retail barcodes printed in North America are GTIN-12 (UPC-A), whilst European and international products typically use GTIN-13 (EAN-13). Some systems encode this information in the barcode format itself (line width patterns), so a barcode reader can auto-detect it.

Can I use this calculator to verify a barcode I've already scanned?

Yes. Enter all digits except the final check digit, and the calculator will compute what the check digit should be. If the result matches the last digit on your barcode, the code is valid. If it doesn't match, either the barcode has been damaged or mistyped, or it's counterfeit. This validation catches human entry errors, transposition mistakes, and manufacturing defects in printing.

What happens if my check digit calculation gives 10?

The modulo 10 algorithm occasionally yields 10 as an intermediate result. In this case, you always use 0 as the final check digit. This rule ensures the check digit is always a single digit (0–9). After you subtract from the next multiple of 10, if the remainder is 10, replace it with 0; this is built into the formula shown above.

Does a valid check digit guarantee the product is legitimate?

A valid check digit confirms the barcode number is mathematically correct and hasn't been altered or mistyped, but it does not prove authenticity. Counterfeiters can print barcodes with valid check digits. However, a valid check digit does rule out accidental transcription errors, which is essential for inventory accuracy and point-of-sale scanning.

Why do barcodes have leading zeros, and do they affect the check digit?

Leading zeros are part of the GTIN standard and serve specific purposes: they may indicate the country of registration, packaging level, or special product categories defined by GS1. Yes, leading zeros are mathematically active in the check digit calculation—they are not decorative. Always include them when validating a barcode, or verification will fail.

Can I calculate GTIN check digits for purposes other than barcodes?

Absolutely. The modulo 10 algorithm is used for ISBN-13 (book identifiers), bank account numbers in some countries, and shipping container codes (GSIN, SSCC). The formula is identical, though the interpretation of digit positions may vary slightly. Always confirm which specific standard applies to your use case before implementing automated validation.

More finance calculators (see all)