What a 13-digit barcode is
The barcode on most products sold in Europe and much of the world is an EAN-13: a pattern of dark bars and light spaces encoding a 13-digit number. That number is the product’s GTIN-13 (Global Trade Item Number). A shop scanner reads the number and looks it up in the shop’s own system to find the price and name, so the barcode itself contains no price and no description.
Strictly speaking, GTIN-13 is the product identifier, while EAN-13 is the barcode symbology that carries it. In everyday use, people often call both an “EAN number” or “13-digit barcode”.
What the 13 digits mean
Take the example number in the generator, 5901234123457. Read from the left:
- GS1 prefix (590): the initial digits identify the GS1 member organisation associated with that prefix range; 590 is GS1 Poland. GS1 UK uses 500–509, GS1 US uses 001–019, 030–039 and 060–139. The prefix does not show where the product was made.
- GS1 Company Prefix and item reference: the digits between the GS1 prefix and the final check digit identify the business and its item. Their boundary is not fixed and cannot be reliably determined just by looking at the 13-digit number. A longer licensed company prefix leaves fewer digits for item references. The business assigns a distinct item reference to each separately identified product or variant, following GS1 GTIN allocation rules.
- Check digit (7): calculated from the other twelve, so a scanner can tell when it has misread a digit.
How the check digit is calculated
GS1 uses the same modulo-10 rule for every GTIN. For EAN-13, multiply the first 12 digits alternately by 1 and 3, starting with 1, add the results and subtract the sum from the next multiple of ten:
- Digits: 5 9 0 1 2 3 4 1 2 3 4 5
- × weights: 1 3 1 3 1 3 1 3 1 3 1 3
- = 5 + 27 + 0 + 3 + 2 + 9 + 4 + 3 + 2 + 9 + 4 + 15 = 83
- Next multiple of ten: 90. Check digit: 90 − 83 = 7.
If the sum is already a multiple of ten, the check digit is 0. The generator does this for you: type 12 digits and the 13th is added, or type all 13 and it tells you if the last one is wrong. To check a whole list of numbers, use the check digit calculator.
Barcode image or barcode number?
This page makes the image, for free. Whether the barcode is “valid” for retail depends on the number inside it:
- Selling in shops or on marketplaces: the number must come from GS1, licensed to your company. Amazon and some retailers may verify product identifiers against GS1 records. A number that does not match the relevant records may cause listing problems or rejection.
- Your own stock, shelves or shop till: you can create internal identifiers without a GS1 licence. Restricted-circulation prefixes (including parts of the 200–299 range) are used for certain local applications, but the applicable rules vary by market; for general internal labelling, a format such as Code 128 may be simpler.
Once you have your GS1 numbers, the generator makes barcodes from them like any others; GS1 does not require you to use its own image tool. The steps, costs and the risks of cheap resold numbers are in how to get a barcode for your product.
Books and magazines: 978, 979 and 977
Some EAN-13 prefixes are not companies but whole numbering systems:
- 978 and 979 (“Bookland”): a book’s 13-digit ISBN can be encoded in an EAN-13 barcode. You get the ISBN from your country’s ISBN agency, not from GS1, and type all 13 digits here: the last digit of an ISBN-13 is already its EAN check digit.
- 977: magazines and other serials. The barcode is 977, then the seven digits of the ISSN without its own check digit, then two more digits, then a new EAN check digit. Magazines often add a 2- or 5-digit add-on for the issue number.
EAN-13, UPC-A or EAN-8?
- UPC-A (12 digits) is used in the USA and Canada. It is the same number system: a UPC-A number corresponds to a 13-digit GTIN with a leading zero, and EAN-13 and UPC-A symbols are accepted globally, subject to trading-partner requirements. If your GS1 numbers are from GS1 US, print them as UPC-A with the UPC barcode generator.
- EAN-8 is for packages too small for an EAN-13, such as a lipstick or a pack of chewing gum. EAN-8 numbers are not taken from your EAN-13 range; they are allocated separately under GS1 rules. See the EAN-8 barcode generator.
- ITF-14 goes on outer cartons that hold several retail units; it uses a 14-digit number based on the product’s EAN. See the ITF-14 barcode generator.
What size to print an EAN-13 barcode
At the standard size (100% magnification) an EAN-13 barcode is 37.29 × 25.93 mm, including the digits and the white margins. The narrowest bar is then 0.33 mm wide. For retail packaging, GS1 allows scaling between 80% and 200%:
- 80%: 29.83 mm wide, the smallest size GS1 recommends for retail;
- 100%: 37.29 mm wide, the recommended size;
- 200%: 74.58 mm wide.
Three things go wrong most often on packaging:
- Cutting the bars short. A designer squeezes the barcode into a narrow strip by lowering the bars (“truncation”). GS1 advises against it because it makes omnidirectional scanning harder. Limited truncation can be allowed in some applications, but preserve the full proportional height whenever possible and check your retailer’s specifications.
- Losing the white margins (quiet zones). The barcode needs empty space of 11 bar widths on the left and 7 on the right: 3.63 mm and 2.31 mm at 100%. That is why a correct EAN-13 is wider than its bars. Keep text, borders and folds out of these margins.
- Ink spread. On many printing presses ink spreads and makes every bar slightly thicker. Printers compensate with a “bar width reduction”. Ask your printer for the value.
The generator provides size and print controls: choose PDF or EPS as the format to get a vector file at exact size, with the margins included, set the magnification (80–200%) and enter the bar width reduction your printer gives you. SVG is also exact, but you set its size yourself in your design program; PNG suits labels and screens rather than packaging.
Why EAN-13 barcodes fail to scan, and how to test yours
- Colours. Shop scanners use red light, so red, orange or yellow bars look like empty space to them. Use black or dark blue bars on a white or light background. Dark backgrounds and metallic or transparent material without a white underprint are risky.
- Curved surfaces. On tightly curved packaging, such as small cans or bottles, ask your printer whether a ladder orientation (with horizontal bars) would improve scanning.
- Folds, seams and see-through film. Keep the barcode on a flat, solid area of the pack.
- The wrong number. A barcode can scan perfectly and still identify the wrong product: for example, because of a typo in the item reference or a number assigned to two variants. Keep a list of which number belongs to which product, and do not reassign a GTIN to another product.
To test: print a sample at the final size on the final material, if possible. A phone barcode scanner app tells you whether it scans and whether the digits are right. It does not tell you whether it meets retail print quality. Large retailers may ask for a verification report: a barcode verifier grades the print to ISO/IEC 15416. GS1 offices and specialist printers offer this service.
Many products at once
Switch to Batch from CSV above and list one product number and name per row: you get every barcode in one ZIP, named after the product, or printed on label sheets.