EAN-13 barcodes: getting, checking and printing them
The EAN-13 is the 13-digit barcode printed on almost every product sold in Europe and the UK. It identifies one product worldwide: two different products must never share the same number. That is what lets a till, a marketplace or a warehouse know exactly what has been scanned.
What the 13 digits mean
An EAN-13 (also called a GTIN-13) has three parts:
- The company prefix, issued by GS1. Its first digits show which GS1 organisation issued it, for example 50 for GS1 UK. It does not show where the product was made.
- The item reference, which the company assigns to each product and each variant (size, colour, pack size).
- The check digit, the last digit, calculated from the first twelve. It lets the scanner detect a misread.
Getting EAN-13 barcodes for retail
To sell through supermarkets, chemists or most online marketplaces, the barcodes must be registered to your company. In the UK this means joining GS1 UK. You receive a company prefix, create your product numbers and record each product’s data with GS1. The annual fee depends on turnover; current prices are published by GS1 UK.
You will find barcodes sold online for a few pounds each. These are usually numbers from old prefixes registered to another company. They may work in a small independent shop, but retailers and Amazon increasingly check that the barcode belongs to the brand selling the product. A mismatch can block your listing.
What about internal use?
For stock, bin locations, tools or samples you don’t need GS1 numbers:
- the simplest option is Code 128, which accepts letters and digits (
ART-1001,BAY-B4). See Code 128 vs EAN-13; - if your software only accepts EAN-13, GS1 reserves prefixes 20 to 29 for numbers used inside one company. These must never leave your business, because other companies use the same numbers.
Working out the check digit
The generator adds the check digit if you enter 12 digits, and rejects a 13-digit code whose check digit is wrong. Here is the calculation for the internal example 200123456789:
- Starting from the right, multiply the digits alternately by 3 and by 1: 9×3, 8×1, 7×3, 6×1, 5×3, 4×1, 3×3, 2×1, 1×3, 0×1, 0×3, 2×1.
- Add them up: 27 + 8 + 21 + 6 + 15 + 4 + 9 + 2 + 3 + 0 + 0 + 2 = 97.
- The check digit is what’s needed to reach the next multiple of ten: 100 − 97 = 3.
So the full code is 2001234567893. One typo in the first twelve digits changes the result, which is why a mistyped code is rejected by the scanner.
Printing an EAN-13 that scans at the till
- Size: at 100 %, an EAN-13 is 37.29 mm wide including its quiet zones. It can be reduced to 80 % or enlarged to 200 %. Details in minimum barcode size.
- Height: avoid shortening the bars. A handheld scanner often copes with a truncated barcode; a fixed checkout scanner much less so.
- Contrast: black bars on a white background. Red, orange or yellow bars are invisible to red-light scanners.
If a printed barcode won’t scan, see barcode not scanning.