A GTIN — Global Trade Item Number — is the number that identifies a product. UPC and EAN are barcode symbologies that carry that number. People use the terms interchangeably and then get confused when a marketplace asks for a "GTIN" and they only have "a barcode": you almost certainly have both, because the barcode is just the machine-readable rendering of the number.
The four GTIN lengths
| Name | Digits | Usual barcode | Typical use |
|---|---|---|---|
| GTIN-8 | 8 | EAN-8 | Very small packages |
| GTIN-12 | 12 | UPC-A | Retail, primarily North America |
| GTIN-13 | 13 | EAN-13 | Retail, most of the world |
| GTIN-14 | 14 | ITF-14 | Cases and cartons, not retail checkout |
A GTIN-12 padded with a leading zero is a valid GTIN-13 — the same product, expressed at a different length. This is why databases should store GTINs right-aligned at 14 digits: it makes comparisons work instead of producing phantom mismatches.
Where GTINs come from
GS1 is the organisation that issues company prefixes. You license a prefix, and that prefix forms the start of every GTIN you assign; you allocate the item reference digits yourself, then compute the check digit.
Cheap barcodes are sold online outside this system, often resold from prefixes issued decades ago. They will scan. The problem arrives later: major marketplaces and retailers increasingly verify that a GTIN resolves to your company in GS1's records, and a number registered to someone else can get a listing suppressed. If products are going into retail or onto a large marketplace, get the prefix from GS1 directly.
How the check digit works
The last digit of every GTIN is a modulo-10 check digit, and it's the reason a mis-scan usually fails loudly instead of silently returning the wrong product.
For an EAN-13, take the first 12 digits and multiply them alternately by 1 and 3, starting with 1:
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
Products:5 +27 +0 +3 +2 +9 +4 +3 +2 +9 +4 +15 = 83
Then subtract the sum from the next multiple of ten: 90 − 83 = 7. The complete GTIN-13 is 5901234123457.
Any generator worth using computes this for you and rejects a payload whose check digit doesn't match — a validation step worth insisting on, because a wrong check digit means labels that fail at the till after you've printed 5,000 of them.
Printing barcodes that actually scan
Quiet zones. The blank margin either side of the bars is part of the symbol, not padding you can trim. Crowd it and scanners fail.
Module width and size. Barcodes have a nominal size range; shrinking one to fit a cramped label is the most common cause of unreadable codes.
Contrast and colour. Dark bars on a light background. Red bars can be invisible to some laser scanners; light bars on dark are non-standard.
Resolution. Generate at print DPI — 300 or higher — or use vector output. A 72 DPI PNG stretched to label size produces fuzzy bar edges and inconsistent reads.
Test on the real substrate. Glossy film, curved bottles and corrugated card all behave differently from paper on a desk.
curl -X POST https://www.ashdocs.com/api/v1/tools/barcode \
-H "X-API-Key: ash_live_..." \
-H "Content-Type: application/json" \
-d '{"data":"5901234123457","symbology":"ean13",
"options":{"format":"svg","height_mm":25,"quiet_zone":true}}'
SVG output scales to any label size without losing edge definition — the safest default for print. For one-off codes, the free barcode generator does the same job in the browser.
What Sunrise 2027 changes
GS1's Sunrise 2027 initiative aims for retail point-of-sale systems to be able to scan 2D codes — GS1 DataMatrix and GS1 Digital Link QR codes — alongside traditional 1D barcodes by the end of 2027, with those 2D codes carrying the GTIN and potentially extra data such as expiry dates or serial numbers. During the transition, products are expected to carry both: the familiar 1D barcode plus a 2D code.
The practical implication for anyone generating labels: your tooling should already be able to emit DataMatrix and GS1 Digital Link QR codes as well as EAN and UPC, so adding a 2D code is a configuration change rather than a project.
FAQ
Is a GTIN the same as a UPC? Not quite. The GTIN is the number; UPC-A is a barcode format that encodes a 12-digit GTIN. A UPC contains a GTIN, but "GTIN" also covers the 8, 13 and 14-digit variants.
Where do I get a GTIN? From GS1, by licensing a company prefix. Numbers resold outside that system will scan but may not verify against GS1 records, which can cause problems with marketplaces and retailers.
How is the GTIN check digit calculated? Multiply the digits alternately by 1 and 3, sum them, then subtract that sum from the next multiple of ten. The result is the final digit.
What is GTIN-14 used for? Case and carton identification — typically printed as ITF-14 on outer packaging. It isn't intended for retail point-of-sale scanning.
Do I need 2D barcodes now? Not yet, but plan for them. Sunrise 2027 is a transition toward point-of-sale systems reading 2D codes, and products are expected to carry both formats during the changeover.
Generate EAN, UPC, ITF-14, DataMatrix and GS1-128 codes via one endpoint — see the Barcode API.