Episode V008 · Source record

Why the Last Digit of a Retail Barcode Is Different

In an EAN-13 or UPC-A retail number, the final digit is calculated from the digits before it. A mismatch can expose a changed decoded number, but a passing check does not prove authenticity, allocation, or price.

Research recheck
August 10, 2026
Evidence stack
9 source records · 9 direct links
Visual proof
Original arithmetic model
Controlled explanatory numbers · no product, price, retailer, or database lookup

The sourced answer

The final digit checks the number before it.

Alternate 3 and 1

The earlier digits receive alternating weights of 3 and 1. Add the products, then choose the final digit needed to reach the nearest equal or higher multiple of ten.

A mismatch can expose a change

GS1's public example totals 57 and needs a final 3. Change one earlier digit and the required final digit can change with it.

A pass proves very little

The arithmetic does not authenticate a product, verify a price, perform a lookup, identify the wrong digit, or repair damaged bars.

Original check-digit model

Change one body digit. Keep the old check digit.

The controlled mutation changes `6291041500213` to `6291041500223`. The weighted body total becomes 60, so the required final digit becomes 0 instead of the supplied 3.

Illustrative check-digit model. Not a product lookup.

  • 117 of 117 single-digit substitutions failed the modeled check
  • 80 of 90 ordered unequal adjacent swaps were detected
  • 10 adjacent-pair cases were not detected
  • At least one two-body-digit change retained the original check digit

These are original deterministic model results, not scanner-performance statistics. Passing the arithmetic establishes consistency only.

Controlled decoder observation

The valid control decoded. The deliberate mismatch returned no barcode.

Same geometry

Both original lossless test images used the same dimensions, module scale, and Quiet Zones.

Same decoder call

The valid control ran first. Both files then used zxing-cpp 3.1.1 with the same EAN13-only call.

Narrow conclusion

The mismatch returned no barcode for this exact file and configuration. That result does not diagnose every failed physical scan.

Direct source library

Trace every public claim.

Each note states what its reference supports and where the evidence stops. External sources open in a new tab.

Current standards

The rightmost digit has a different job

These official references support the EAN-13 and UPC-A scope, the alternating 3 and 1 arithmetic, and the limits of that whole-number check.

S01Rechecked 2026-08-10

GS1 General Specifications, release 26.0

GS1

Pages 324 to 327, 529, and 544 to 545 support the EAN/UPC structure, reader verification, fixed-length numeric check calculation, and the distinction from other symbol mechanisms. No source figure or table is reproduced.

S02Rechecked 2026-08-10

ISO/IEC 15420:2025

International Organization for Standardization

The public record identifies the current EAN/UPC bar-code symbology standard and its scope. The full normative text is paywalled and is not quoted or reproduced here.

S03Rechecked 2026-08-10

How to Calculate a Check Digit Manually

GS1

GS1 publishes the GTIN-13 arithmetic example used in the episode. The first twelve digits produce a weighted total of 57, so the final digit is 3.

S04Rechecked 2026-08-10

Check Digit Calculator

GS1

GS1 describes the check digit as a key-integrity calculation. The public calculator is a reference, not evidence of product allocation, authenticity, price, or inventory.

Barcode context

One rule does not describe every barcode

These sources provide current retail and historical context without turning the EAN/UPC rule into a universal barcode claim.

S05Rechecked 2026-08-10

Barcoding Basics

GS1 US

This overview supplies supporting retail-barcode context. It is not used to claim that a passing check digit authenticates a product or verifies a database record.

S06Rechecked 2026-08-10

2D Barcodes at Retail Point-of-Sale Implementation Guideline

GS1

The guideline supplies current context for linear and 2D barcodes at retail. It does not establish one universal replacement date or make QR error correction equivalent to an EAN-13 check digit.

S07Rechecked 2026-08-10

50 Years of GS1

GS1

This optional history page provides background only. It is not primary support for the check-digit mechanism or the controlled decoder result.

Controlled decoder test

One observed result, with a narrow boundary

The selected decoder and package records identify the exact tool used. The result applies only to the preserved files and EAN13-only call.

S08Rechecked 2026-08-10

zxing-cpp

zxing-cpp contributors

The official repository identifies the decoder project and Apache-2.0 license. No source code, logo, screenshot, or interface design is reproduced.

S09Rechecked 2026-08-10

zxing-cpp 3.1.1

Python Package Index and zxing-cpp maintainers

The package record establishes the exact selected version. The local test performed no product or network lookup and returned no barcode for the deliberate mismatch after the valid control decoded.