Barcode Types Explained
A quick comparison of the common 1-D barcode formats and where each one fits.
On this page
Retail product codes
UPC-A (12 digits) is the North American retail standard; EAN-13 (13 digits) is its global counterpart; EAN-8 (8 digits) is the compact version for small packages. All three carry a check digit and require an official GS1 number for real retail use — generating an image doesn't register a product.
General-purpose codes
Code 128 is dense and flexible, encoding digits, letters and ASCII symbols — the workhorse of shipping and logistics. Code 39 is older and lower-density but very widely supported, popular for IDs, badges and industrial labels.
Shipping and specialty codes
ITF-14 encodes a 14-digit GTIN on shipping cartons, often with heavy bearer bars. Codabar is a self-checking code still used by libraries, blood banks and labs.
Comparison at a glance
| Format | Data | Typical use |
|---|---|---|
| UPC-A | 12 digits | US/Canada retail |
| EAN-13 | 13 digits | Global retail |
| EAN-8 | 8 digits | Small retail packs |
| Code 128 | ASCII text | Shipping, logistics |
| Code 39 | A–Z, 0–9, few symbols | IDs, badges, industry |
| ITF-14 | 14 digits | Shipping cartons |
| Codabar | Digits + few symbols | Libraries, labs |
When a linear code runs out of room
Every format above stores its data across a single line of bars, which caps capacity at a short number or string. Once you need more — a batch, an expiry date and a serial together, or a whole record — you need a two-dimensional symbology that stores data in both directions.
| Format | Best at | Typically used for |
|---|---|---|
| Data Matrix | Very small marks | Part marking, electronics, instruments |
| GS1 DataMatrix | Structured GS1 data | Medicine packs, medical devices |
| PDF417 | Large payloads, laser-readable | Driving licences, boarding passes |
| Aztec Code | No quiet zone needed | Rail tickets, transport passes |
| QR Code | Phone cameras | Anything the public scans |
The practical split: QR for the general public, because every phone camera recognises it without extra software. Data Matrix when the mark has to be tiny. PDF417 or Aztec when an existing standard in transport or identity documents requires them.
Which should you choose?
For retail, use the code your market expects (UPC or EAN) with a registered GS1 number. For internal tracking, Code 128 offers the best density; choose Code 39 or Codabar when legacy compatibility matters. If the data outgrows a single line, move to Data Matrix — or to QR if people will scan it with their own phones.
Written and maintained by the QRBarcodeTools Editorial Team · Last reviewed 2026-08-02 · How we write and check these guides