GTIN & product identifiers

How to calculate a barcode check digit: UPC, EAN & GTIN

Use the GS1 Modulo-10 rule to add a missing final digit or check an existing number—and understand what the result does and does not prove.

Quick answer: remove the existing check digit if there is one. Starting from the rightmost remaining digit, multiply digits alternately by 3 and 1, then add the products. The check digit is the amount needed to reach the next multiple of ten, or zero when the sum is already divisible by ten. To calculate or validate one number or a batch, use the free barcode check digit generator and calculator.

What a barcode check digit means

A check digit is the final digit of a GTIN, calculated from all the digits before it. A scanner or software system can repeat the calculation and compare the result with the final digit. A mismatch warns that the number was probably typed or read incorrectly.

The digit is not a serial number, country code, company prefix or security feature. It carries no product information by itself.

IdentifierPayload before check digitComplete numberCommon barcode
GTIN-87 digits8 digitsEAN-8
GTIN-1211 digits12 digitsUPC-A
GTIN-1312 digits13 digitsEAN-13
GTIN-1413 digits14 digitsITF-14 for cartons

UPC-A check digit calculation, step by step

Take the 11-digit UPC-A payload 01234567890. From right to left, the weights alternate 3, 1, 3, 1. Written from left to right for this 11-digit payload, that makes the weights 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3.

Payload digit01234567890
Weight31313131313
Product01631251872490
  1. Add the products: 0 + 1 + 6 + 3 + 12 + 5 + 18 + 7 + 24 + 9 + 0 = 85.
  2. The next multiple of ten after 85 is 90.
  3. 90 − 85 = 5, so the check digit is 5.
  4. The complete UPC-A is 012345678905.
GS1 Modulo-10 UPC-A example with payload 01234567890, weighted sum 85 and check digit 5
The same worked example is available interactively in QRacade's calculator, including the digit-by-digit products.

EAN-8, EAN-13 and GTIN-14 use the same rule

The weighting is anchored from the right, not from an arbitrary first position. This matters because payload lengths differ. For EAN-13, the 12-digit payload 590123412345 has a weighted sum of 83 and therefore needs check digit 7: 5901234123457.

For a GTIN-14 example, 1001234567890 becomes 10012345678902, with check digit 2. The identifier may then be printed as an ITF-14 carton symbol. The identifier and the symbology used to draw it are separate decisions.

Adding a leading zero does not change a GS1 Modulo-10 result because zero contributes nothing to the weighted sum. That is why a UPC-A and its zero-padded EAN-13 representation can share the same final check digit.

How to validate an existing barcode number

  1. Confirm the expected format and complete length: 8, 12, 13 or 14 digits.
  2. Temporarily remove the final digit from the calculation, without deleting it from your source record.
  3. Calculate the expected digit from the remaining payload.
  4. Compare it with the supplied final digit. Equal values pass the arithmetic check.

If the result differs, do not assume the final digit is the only mistake. An earlier digit may have been typed incorrectly while the final digit was copied correctly from the source. Compare the entire identifier with the product record or GS1 assignment before accepting a correction.

The calculator's Validate mode is deliberately separate from Calculate: 12 digits can mean either a complete UPC-A or an EAN-13 payload that still needs its final digit.

Common check digit mistakes and how to fix them

Excel removed a leading zero

GTINs are identifiers rather than quantities. Spreadsheet software can remove leading zeros, display long values in scientific notation or round them. Format source columns as Text before entering or importing identifiers, then compare the export with the original record. A missing zero cannot always be inferred safely from a shortened value.

The number has the right checksum but the wrong digits

A mathematically valid number can still belong to another product or no product at all. Recheck the source identifier rather than generating a fresh check digit for an unverified payload.

The checksum is valid but the printed barcode will not scan

The identifier and image need separate checks. Review narrow-bar width, quiet zones, contrast, blur, glare and damage in the barcode print-size and quiet-zone guide. A valid number cannot compensate for an unreadable printed pattern.

Not every format uses this exact rule

GS1 GTINs use this Modulo-10 method. CODE 128 has an internal symbol checksum, CODE 39 workflows may specify a different optional Modulo 43 character, and a North American VIN uses its own position-weighted rule. Do not apply the GTIN formula indiscriminately to every identifier.

What a valid check digit does not prove

  • It does not assign or register a GTIN with GS1.
  • It does not look up the product, brand owner or company-prefix licensee.
  • It does not prove authenticity, retailer acceptance or marketplace compliance.
  • It does not guarantee that barcode artwork or a printed label will scan.
  • It does not catch every possible transposition or multi-digit error.

For allocation and ownership questions, use your product-data records and the appropriate GS1 services. Keep arithmetic validation, identifier lookup and physical scan testing as distinct steps.

Frequently asked questions

What is a barcode check digit?

It is the final digit calculated from the preceding digits in a GTIN. Scanners and software use it to detect common typing and reading errors. It does not contain product or company information.

Is the check digit algorithm the same for UPC and EAN?

UPC-A, EAN-8, EAN-13 and GTIN-14 all use the same right-anchored GS1 Modulo-10 weighting. Only the payload and complete lengths differ.

Can a check digit tell me who owns a barcode number?

No. The calculation checks arithmetic only. It cannot look up a product, identify the licensee, prove GS1 registration or establish authenticity.

Will a valid check digit guarantee that a printed barcode scans?

No. The digits can be valid while the printed symbol fails because of narrow bars, insufficient quiet zones, blur, glare, damage or scanner configuration.

Check your numbers

Calculate or validate a check digit

Process one UPC, EAN or GTIN number, or paste a batch and download the results as CSV. Everything runs locally in your browser.

Open barcode check digit calculator

Related tools and guides