Skip to content
FlashScan Pro

EAN-13 explained: digit structure and the check digit formula

What do the 13 digits of an EAN-13 mean? GS1 prefix, item reference, check digit formula — plus the manufacturing-country myth, debunked here.

Thirteen digits, three pieces of information

The barcode on the back of nearly every product follows the EAN-13 format: thirteen digits organized into three logical zones. The first 2 or 3 digits form the GS1 prefix — the series assigned to the national organization (300-379 for GS1 France, 000-019 for GS1 US, for example). The following digits identify the company and then the item — the exact split varies with the length of the assigned company prefix. The last digit is the check digit: it identifies nothing, it verifies everything.

The digits printed under the bars aren’t just decoration: they’re the human-readable fallback. When a bar gets scratched or poorly printed, the cashier can type the thirteen digits by hand — and the same check-digit verification applies, which is why a mistyped digit is caught instantly rather than selling the wrong product.

The check digit, step by step

The check digit catches transcription or reading errors: a mistyped digit breaks the expected total. The algorithm, applied to the first 12 digits:

  1. Add the digits at odd positions (1st, 3rd, 5th…) × 1.
  2. Add the digits at even positions × 3.
  3. The check digit is the complement to 10: (10 − (total mod 10)) mod 10.

Worked example with 590123412345:

  • Odd positions: 5+0+2+4+2+4 = 17
  • Even positions: 9+1+3+1+3+5 = 22 × 3 = 66
  • Total: 17 + 66 = 83 → complement to 10 = 7

The complete code is 5901234123457. If a reader misreads a digit, the total no longer matches the check digit and the scan is rejected — that’s why the register beeps “invalid” rather than selling the wrong item.

In FlashScan Pro’s generator, typing the first 12 digits is enough: the check digit is computed and the full code shown with the graphic. Entering 13 digits also works — the check digit is verified.

The visible anatomy of the bars

Look at an EAN-13 closely: the twelve digits printed under the bars split into two groups of six, separated by guard bars in the center, with guard bars at the start and end too. These longer guard bars let the reader calibrate module width and read the code in both directions.

The subtle detail: the first digit is encoded in no bar at all. It drives the parity of the six bars in the left group — each first-digit value imposes an even/odd parity pattern across the six positions, and the reader deduces the digit from it. That’s why FlashScan Pro’s generator, which reconstructs the encoded text, must place that first digit back in front of the displayed string: it isn’t in the bars, it’s inferred from their structure.

The “manufacturing country” myth

A persistent misconception: “the prefix tells where the product is made.” False. The prefix identifies the GS1 organization that assigned the series — the country where the company registered its numbers. A product manufactured in Asia for a French brand registered with GS1 France carries a 30-37 prefix. Manufacturing origin is on the regulatory label, not in the barcode.

The North American UPC-A is EAN-13’s elder — and technically a subset: a UPC-A is an EAN-13 whose first digit is 0. Prepend a zero to your twelve UPC-A digits and you get the equivalent EAN-13, readable by the same scanners. That’s why modern US checkouts, built for GS1, accept EAN-13 without special configuration. The choice between the two is made at GS1 registration according to the target market, not when drawing the bars — the full comparison is in Code 128 vs EAN-13 vs UPC-A.

Why the check digit exists at all

Without a check digit, a poorly printed bar, a stain, or a hand-copied digit would go unnoticed: the register would sell “the nearest article” or reject without explanation. The check digit turns every read into a verification: the reader recomputes the expected total and compares it to the 13th digit. On mismatch, it refuses — the error beep you hear at the register is often this mechanism at work, not a “broken” code.

Graphic vs number: two different things

Generating an EAN-13 at home is trivial — the format is public and the check digit is simple math. What isn’t free is the number: for a code to be recognized at checkout, it must be assigned by GS1 under license, guaranteeing global uniqueness. The generator produces the graphic and validates the format — perfect for prototyping packaging, testing a scanner, or internal-use labeling; for retail distribution, the number comes from GS1. The comparison with other formats is in Code 128 vs EAN-13 vs UPC-A.

Checking an existing code

To read an EAN-13 on a label — and verify its check digit — the scanner decodes 1D barcodes as well as QR codes, in the browser and without uploading the image.