Which barcode format do you actually need
There are dozens of barcode symbologies and only a handful you will ever choose between. The choice is almost never about the data. It is about where the label goes, who scans it, and whether the number has to mean something to somebody else.
The question that settles most of it
Ask whether the code has to be understood outside your own organization. That single distinction removes most of the options.
If a product will cross a retailer's checkout, or move through a supply chain that is not yours, the format is not a preference. It is dictated by the trading standards of that channel, and the number in it has to be one you were allocated rather than one you chose. If the code will only ever be read by your own equipment, inside your own building, you are free and should optimize for size and robustness.
Codes for retail checkouts
| Format | Digits | Where it goes |
|---|---|---|
| EAN-13 | 13 | Standard retail item, most of the world |
| UPC-A | 12 | Standard retail item, North America |
| EAN-8 | 8 | Packs too small for a full EAN-13 |
| UPC-E | 8 printed | Compressed UPC for small packs |
| ITF-14 | 14 | Outer cases and cartons, not the consumer unit |
These all carry a GTIN, a globally unique product number. You obtain the company prefix that sits at the front of it from GS1, and you allocate item numbers within it yourself. Generating the barcode image is trivial and free; being entitled to the number in it is the part that takes an application.
Codes for your own operations
Asset tags, shelf locations, work orders, internal totes. Nobody outside needs to interpret these, so pick on density and tolerance.
- Code 128 is the sensible default. It encodes the full ASCII set, and its numeric subset packs two digits into the space of one character, which makes it noticeably more compact than the alternatives for numeric data.
- Code 39 is older, less dense and encodes a limited character set, but it is simple, self-checking and supported by absolutely everything. It survives in defense, automotive and healthcare systems for that reason. Choose it when you are matching existing equipment, not when you are starting fresh.
- Data Matrix when the label is tiny. It is a two-dimensional code that stays readable at a few millimeters square and is the standard choice for marking components directly, by laser or chemical etch.
When you need a two-dimensional code
Linear barcodes hold a modest number of characters and get physically wider with every one you add. Two-dimensional codes grow in both directions, so they hold far more in a compact area, and they carry their own error correction.
| Format | Strength | Where you meet it |
|---|---|---|
| QR | Universal consumer support | Anything a member of the public scans |
| Data Matrix | Very small, robust | Component marking, medical devices, mail |
| PDF417 | Large capacity, stacked rows | Driving licenses, ID cards, boarding passes |
| Aztec | No quiet zone needed, compact | Rail and airline tickets, phone screens |
The dividing line between QR and the rest is who is holding the reader. QR is the only one an ordinary phone camera recognizes without an app, so anything aimed at the public is a QR code and the others are not options. Everything else on that list assumes purpose-built equipment at the reading end.
Aztec is worth knowing about for one specific property: it needs no clear margin around it, because its finder pattern is a bullseye at the center rather than squares at the corners. That is why it dominates ticketing, where codes are crammed against the edge of a small ticket or a phone screen.
Codes that carry structured data
A case moving through a supply chain often needs to carry more than an identifier: a batch number, an expiry date, a serial. GS1-128 is Code 128 with a convention laid over it that says what each field means, and GS1 DataMatrix does the same thing in two dimensions where the label is small.
If that is your situation, the format choice is downstream of the data standard, and the thing worth learning is the identifier scheme rather than the bars.
The short version
- Sold at retail: EAN-13 or UPC-A, with a GTIN from GS1.
- Outer case of the same product: ITF-14.
- Batch, expiry or serial alongside the identifier: GS1-128, or GS1 DataMatrix if space is tight.
- Your own equipment, your own numbers: Code 128.
- Matching legacy equipment: Code 39.
- Marking a physical part a few millimeters across: Data Matrix.
- Scanned by the public with a phone: QR.