Reference · 10 min read
Which barcode symbology you actually need
The map through EAN-13, UPC-A, Code 128, ITF-14, Data Matrix and the rest: what each one is actually for, and why a retail number has to come from GS1.
You need a barcode on something, and the generator you opened offers about twenty. EAN-13, UPC-A, Code 128, Code 39, ITF-14, Data Matrix, PDF417, Aztec, Codabar. None of the names tell you what they are for, and choosing wrongly fails in a particularly annoying way: the symbol prints, it scans on your desk, and then it is rejected by the retailer, the distributor or the scanner it was actually meant for.
This page is the map. It is organised by what you are labelling, because that — not the amount of data, and certainly not how the symbol looks — decides the answer.
There are only two kinds of barcode
Every question below is a variation on one split.
- Retail codes encode a number you do not own yet. EAN-13, UPC-A, EAN-8, UPC-E, ITF-14 and the SSCC all carry a GTIN or a close relative, and that number is licensed to you by GS1. Once you know which number you hold, the symbology is already decided for you.
- General codes encode whatever text you like. Code 128, Code 39, Data Matrix, QR, PDF417, Aztec. Nobody issues anything, nobody registers anything, and the only requirement is that your own system agrees with itself.
If the thing will be scanned at a till or bought by a distributor, you are in the first group and the rest is about picking the variant. If you are labelling your own shelves, tools, jigs, cables, samples or work orders, you are in the second group and the answer is almost always Code 128.
The GS1 part that trips everyone up
Say it plainly: a retail barcode number has to be licensed from GS1. Any generator, including ours, will happily take twelve digits you invented, calculate a mathematically correct check digit, and draw a flawless EAN-13. It will scan first time on every scanner in the world. It is still not your number.
Two consequences are worth spelling out.
- It probably belongs to someone. GS1 prefixes are allocated globally, so twelve digits you made up most likely sit inside a range issued to a real company in a real country.
- Buyers check. Amazon validates GTINs against the GS1 registry and suppresses listings that fail. Supermarket and pharmacy onboarding does the same. The barcode is not the problem; the provenance of the number is.
You will also find companies selling single barcode numbers cheaply. Those are usually genuine numbers from a prefix issued before 2002 and sublicensed onward. Small independent shops often accept them. Large chains and marketplaces generally do not, because the registry says the number belongs to the reseller rather than to you. It is a real option for a market stall and a bad one for a retail listing.
Three cases where you need no GS1 licence at all: a book, where the number comes from your national ISBN agency; anything internal, where you invent the format; and cartons that never leave your own building.
Retail: EAN-13, UPC-A, and the two short ones
The choice between EAN-13 and UPC-A is geography, not capability. Every retail scanner made in the last thirty years reads both, and a UPC-A is simply an EAN-13 with a leading zero.
| Code | Digits | Use it for |
|---|---|---|
| EAN-13 | 13 | Products sold anywhere outside North America. The global default. |
| UPC-A | 12 | Products sold in the US and Canada, and most Amazon listings. |
| EAN-8 | 8 | Packs with genuinely no room for EAN-13. GS1 rations these. |
| UPC-E | 8 | The zero-suppressed UPC for small US packs. Only some numbers compress. |
| ISBN | 13 | Books. The EAN-13 form of your ISBN, plus the price add-on. |
Print one, not both. An EAN-13 at 100% magnification is 37.29 mm wide with 22.85 mm bars, and the retail specification allows anything from 80% to 200% of that. Shrinking below 80% is where scan failures start, and it is far more common than people think, because artwork gets rescaled to fit a label rather than the label being drawn to fit the code.
EAN-8 and UPC-E are not the small-product options, they are the last-resort options. Reach for them only after you have confirmed a reduced-size EAN-13 will not fit the available flat area, quiet zones included.
For books, the ISBN already carries its 978 or 979 prefix, so it becomes an EAN-13 directly. Add the five-digit price supplement if you sell into US bookshops: 51999 means $19.99, and 90000 means no price encoded. The retail barcode pages handle the conversion and the check digit.
General purpose: Code 128, and why Code 39 will not die
Code 128 is the correct default for anything internal. SKUs, asset tags, serial numbers, shelf locations, work-order numbers, sample IDs. It takes any ASCII text, it is the densest linear symbology in common use, and it has a check character built in that you never have to think about.
Its one real limit is physical width. Long values get wide fast, so keep internal codes to roughly twenty characters; GS1 caps a Code 128 symbol at 165 mm. Past that point the honest answer is a 2D code, not a smaller bar width.
Code 39 is worse than Code 128 in every measurable way. Upper case only, no lower case at all, digits and a handful of punctuation, no check digit unless the receiving system asks for the optional mod-43 one, and roughly a third wider for the same data. It survives because it dates from 1974, was never patent-encumbered, and is trivial to implement in firmware. That means it is still baked into older automotive and defence labelling standards, some lab instruments, and a great many badge and access-control systems.
The rule is simple. Use Code 39 when a system you do not control demands Code 39. Never choose it for something new. The same applies to Code 93, Codabar, Interleaved 2 of 5, MSI Plessey and Pharmacode on the other 1D page: if you are reading one of those names off an existing label, match it exactly; otherwise ignore them.
Logistics: what an application identifier actually is
Trading-partner logistics is where a barcode stops being an identifier and starts being a small record. That is what application identifiers do. An AI is a two-to-four digit prefix that says what the following data means and how long it is.
| AI | Field | Format |
|---|---|---|
| (01) | GTIN of the item | Exactly 14 digits |
| (10) | Batch or lot | Up to 20 characters |
| (17) | Expiry date | YYMMDD |
| (21) | Serial number | Up to 20 characters |
| (00) | SSCC, one logistic unit | Exactly 18 digits |
So (01)09501234567891(17)261231(10)LOT42 is one barcode carrying three labelled fields, and every scanner in the chain splits them the same way without being told your conventions. Note the 14 digits: a 13-digit EAN goes in with a leading zero.
Three symbols do the work, and they are not interchangeable.
- ITF-14 goes on the outer carton, and nowhere else. It holds a GTIN-14 — a packaging indicator digit, the product digits, a fresh check digit — and it is drawn deliberately coarse: 1.016 mm bar width, 32 mm tall, with mandatory bearer bars. All of that exists because corrugated board prints badly and a half-read symbol is worse than no symbol.
- GS1-128 is the same bars as Code 128 with a start character that tells the scanner GS1 rules apply. Use it whenever a trading partner scans the label, and plain Code 128 when only you do.
- SSCC-18 identifies one pallet or one shipment, not a product. It travels inside a GS1-128 as AI (00), and the serial part is yours to allocate — one per unit, never recycled in a hurry.
2D: Data Matrix, QR, PDF417 and Aztec
All four are error-corrected, so all four still read when partly scratched. They differ in what they were designed to survive.
Data Matrix versus QR is the one worth understanding. QR spends three large finder squares plus alignment patterns on being found quickly by a moving phone camera, and its smallest version is 21 modules square. Data Matrix spends one solid L-shaped edge and a one-module clock track, and starts at 10 modules square. Proportionally less of the symbol is structure, so at the same printed size it holds more, and at the same data it prints smaller.
That is why electronics standardised on it. You can laser-mark a Data Matrix about 2.5 mm across onto an IC, a connector or a bare PCB and a fixed machine-vision camera will read it every time. The trade is real though: most phone camera apps will not read Data Matrix. If a human with a phone is the reader, use QR and accept the larger symbol.
GS1 DataMatrix is Data Matrix carrying the application identifiers above, and it is the required format on medicine packs and medical devices under serialisation rules in the EU, the US and most other regulated markets. If you are labelling pharmaceuticals, this is not a choice.
PDF417 is a stack of short linear rows holding up to about 1,800 characters. It is on North American driving licences, boarding passes and a lot of government and postal forms, entirely because those specifications say so. Choose it when a spec names it, and not otherwise — Data Matrix is smaller for the same payload.
Aztec is the ticket code: rail, Eurostar, IATA boarding passes. Its distinguishing feature is that it needs no quiet zone, which is why it fits into the corner of a crowded ticket where nothing else will.
The decision table
| If you need… | Use | Because |
|---|---|---|
| A product scanned at a till outside North America | EAN-13 | The global retail standard; the number must come from GS1 |
| A product for US or Canadian retail, or Amazon | UPC-A | What those systems expect; it is an EAN-13 with a leading zero |
| A retail pack too small for EAN-13 | EAN-8 or UPC-E | The only shortened retail forms, and GS1 issues them sparingly |
| A barcode for a book | ISBN | Your ISBN already is a GTIN; no GS1 licence needed |
| Internal SKUs, asset tags, serials | Code 128 | Any text, densest linear symbol, check character built in |
| To match an old system that names a format | Code 39 or whatever it names | Compatibility is the only reason these still exist |
| An outer carton for a distributor | ITF-14 | Coarse bars and bearer bars survive printing on cardboard |
| Batch, expiry or serial on a shipping label | GS1-128 | Application identifiers make the fields machine-readable everywhere |
| To identify one pallet or shipment | SSCC-18 | A unique logistic-unit id, carried as AI (00) |
| A mark on a small part or a PCB | Data Matrix | Smallest symbol for the data; reads at a few millimetres |
| Medicine or medical-device packaging | GS1 DataMatrix | The format serialisation regulations require |
| Anything a phone should scan | QR | The only 2D code every phone camera reads unaided |
| An identity document or boarding pass | PDF417 | Mandated by those specifications, not chosen on merit |
| A transport ticket with no room to spare | Aztec | It is the one common code that needs no quiet zone |
Before you send it to print
Whichever you picked, three checks catch nearly every failure. Confirm the check digit was calculated rather than typed. Confirm the quiet zone survived the layout — the blank margin is part of the symbol, and a border drawn tight against the bars will break scanning. Send the printer a vector file, SVG or PDF, so the bar widths stay exact at whatever size the artwork ends up.
Then scan the printed proof, not the screen. Ink spread on the real substrate is the variable nobody models, and it is the reason a code that looked perfect in the PDF comes back from the carton printer unreadable. QR Studio generates all of the above with the check digits and GS1 sizing already handled, which removes the two mistakes that are hardest to spot by eye.
