Your team is launching a new product across UK supermarkets, US mass-market and a German pharmacy chain. By the end of the day someone needs an answer to a question that sounds simple — "which barcode goes on the box?" — and that answer turns out to be different on every channel. The consumer pack wants EAN-13. The US version wants UPC-A. The pharmacy version wants GS1 Data Matrix carrying batch and expiry. The outer case wants ITF-14. The carton-level pallet wraps a GS1-128 with an SSCC. And the marketing team would quite like a QR code on the front for the Digital Link.
There are dozens of barcode formats in the wild, but a dozen account for almost every barcode you'll meet in retail, logistics, healthcare and identity documents. This barcode formats field guide covers what each one encodes, where you'll see it on packaging, paperwork or screens, and which ReadBarcode tool decodes or generates it. By the end of the article you should know the different types of barcodes, the difference between 1D barcode types and 2D ones, and how to identify an unknown barcode from nothing but the printed value.
The short answer
Barcodes split into two families. 1D barcodes are the parallel bars you see on every supermarket pack — they encode short identifiers like the GTIN that the till looks up to find a price. 2D barcodes are the square or stacked grids you see on boarding passes, driver's licences, pharma vials and consumer-marketing posters — they encode a full payload (batch, expiry, URL, serial) inside a much smaller footprint with built-in error correction.
Within each family a handful of symbologies dominate. On 1D side, you'll almost always be choosing between UPC-A, EAN-13, EAN-8, Code 128 (and its GS1-128 cousin), Code 39 and ITF-14. On 2D side, QR Code, GS1 Data Matrix, PDF417 and Aztec cover effectively everything you'll meet. Niche industrial formats exist (Code 93, Codabar, MaxiCode, Han Xin) but if you're reading this for a packaging or logistics decision, you don't need them.
All formats at a glance
The single reference table for the rest of the article. Capacities are practical rather than spec-maximum — what fits on a label and still scans reliably on real hardware.
| Format | Family | Capacity | Where you see it |
|---|---|---|---|
| UPC-A | 1D | 12 digits | US & Canadian retail GTIN |
| EAN-13 | 1D | 13 digits | Worldwide retail GTIN |
| EAN-8 | 1D | 8 digits | Small retail packs (sweets, lip balm, electronics blisters) |
| Code 128 | 1D | ~80 alphanumeric | Shipping labels, asset tags, hospital wristbands |
| GS1-128 | 1D (Code 128 + FNC1) | Code 128 capacity, AI-structured | GS1 logistics labels, SSCC pallet IDs |
| Code 39 | 1D | ~30 alphanumeric (upper only) | Legacy automotive, defence, library catalogues |
| ITF-14 | 1D | 14 digits | Outer cases printed direct on corrugated cardboard |
| ISBN (EAN-13) | 1D | 13 digits (978/979 prefix) | Books, magazines, music |
| QR Code | 2D matrix | ~4,000 alphanumeric | Consumer marketing, payments, GS1 Digital Link |
| Data Matrix | 2D matrix | ~2,300 alphanumeric | Pharma vials, surgical instruments, electronic components |
| PDF417 | 2D stacked | ~1,800 characters | US driver's licences, airline boarding passes |
| Aztec | 2D matrix | ~3,000 characters | Rail and transport tickets (Eurostar, SNCF, Deutsche Bahn) |
1D formats
The 1D family is dominated by GS1-issued retail identifiers (UPC-A, EAN-13, EAN-8, ITF-14) and the alphanumeric workhorses behind them in logistics (Code 128, GS1-128, Code 39). All of them encode data along a single horizontal axis using bars of varying width, all of them carry a trailing check digit, none of them have meaningful error correction.
UPC-A and EAN-13 — the retail backbone
UPC-A is 12 digits, EAN-13 is 13. They're the same product identifier in different sleeves — a UPC-A is an EAN-13 with a leading zero. Every modern point-of-sale scanner reads both. For the full deep-dive on why the two exist, see the UPC vs EAN guide.
50123456789005012345678900 — the typical consumer-pack barcode outside North America.EAN-8 — the short retail form
EAN-8 is a separate 8-digit GS1 allocation for packages too small for an EAN-13. It is not a truncation of EAN-13 — the brand has to apply for the EAN-8 allocation specifically.
9638507496385074, sized to fit on lip-balm-class packaging.ITF-14 — the case-level identifier
ITF-14 is Interleaved 2 of 5 fixed to exactly 14 digits. The thicker bars survive direct-print on corrugated cardboard where the fine bars of an EAN-13 would bleed into each other. It encodes the GTIN-14 of the outer case — the consumer GTIN with an indicator digit on the front.
1061414100041510614141000415 — leading 1 is the packaging-level indicator.Code 128 — the alphanumeric workhorse
Code 128 encodes the full 128-character ASCII range in a dense form, with three internal subsets (A, B, C) that the encoder picks between to keep the symbol narrow. It dominates shipping labels, asset stickers and hospital wristbands. The Code 128 guide walks through subsets and FNC1 in detail.
SHIP-2026-00042SHIP-2026-00042 — a mixed-case alphanumeric payload typical of warehouse labels.GS1-128 — Code 128 with GS1 syntax
GS1-128 is Code 128 with a mandatory FNC1 at the start, signalling that the payload follows GS1 Application Identifier syntax. The bars look identical to a plain Code 128, but parsers treat the contents as a chain of AIs separated by FNC1.
(01)07640156790009(10)ABC123(17)26123107640156790009, batch ABC123 and expiry 2026-12-31 in a single 1D symbol.Code 39 — the legacy alphanumeric
Code 39 predates Code 128 and is still found in defence, automotive and library systems whose scanners haven't been refreshed. It only encodes uppercase letters, digits and a handful of symbols, and produces a symbol roughly twice as wide as Code 128 for the same payload.
ASSET-2026-00042ASSET-2026-00042. Note the wider footprint compared with the equivalent Code 128 above.ISBN — books, magazines, music
The 13-digit barcode on the back of every book is an EAN-13 with a fixed 978 or 979 prefix, allocated globally for publishing. A library system that doesn't know the prefix treats it as a plain EAN-13 and works fine.
97801404491439780140449143 encoded as an EAN-13 barcode — the 978 prefix marks it as a book.2D formats
The 2D family arrived later and addresses two limits of 1D barcodes: capacity and damage tolerance. Every 2D format encodes data in a matrix of light and dark modules with Reed–Solomon error correction that can repair up to roughly 30% of the symbol — the same maths that lets a phone scan a QR code through a coffee stain. The four formats below cover effectively everything in practice; the rest are industrial niches.
QR Code — the consumer 2D
QR (Quick Response) is the format every modern phone camera reads natively. It handles URLs, Wi-Fi credentials, vCards, payments and — increasingly — GS1 Digital Link payloads that double as the retail GTIN. For Sunrise 2027, the QR with a Digital Link URL is what most consumer-pack brands will print alongside the 1D EAN.
https://readbarcode.comhttps://readbarcode.com — the simplest 2D format and the only one a phone camera reads with zero setup.GS1 Data Matrix — the pharma 2D
Data Matrix achieves the same density as QR in a smaller footprint, which is why GS1 mandates it on pharmaceutical secondary packaging, medical devices and unit-dose markings. The GS1 variant uses the same FNC1 + Application Identifier structure as GS1-128, in a square symbol that fits on a vial cap.
(01)05012345678900(10)ABC123(17)26123105012345678900, batch ABC123 and expiry 2026-12-31 in a footprint a few millimetres across.PDF417 — the document 2D
PDF417 is a stacked 2D barcode — rows of small 1D-like patterns stacked vertically — rather than a true matrix. It dominates documents that need a lot of data in a single capture: US driver's licences, airline boarding passes, shipping manifests. Phone cameras read it but support is patchier than QR.
M1DOE/JOHN EABC123 LHRJFKBA 0179 226Y012A0001 100Aztec — the transit 2D
Aztec has a distinctive bullseye finder pattern at its centre and doesn't need a quiet zone, so it scans reliably from glossy phone screens with thin status bars. That makes it the standard for European rail and transport tickets — Eurostar, SNCF, Deutsche Bahn — where the symbol lives on a small screen the passenger flashes at a gate scanner.
M1DOE/JOHN EABC123 LHRJFKBA 0179 226Y012A0001 100How to choose
The choice between formats almost always reduces to four questions: what data are you encoding, what hardware scans it, how much space does the label have, and which standards apply on the receiving end? The pragmatic answers for the common cases:
- Fixed consumer product. EAN-13 worldwide, UPC-A if you have a North American GS1 allocation. Add a QR with a Digital Link if you want a Sunrise-2027-ready consumer pack.
- Books and serials. ISBN-13 as an EAN-13 with
978or979prefix; ISSN as EAN-13 with977. - Outer case or pallet. ITF-14 on the case (corrugated tolerance) or GS1-128 on the pallet (SSCC + AI payload). Don't use EAN-13 on cardboard — the fine bars bleed.
- Internal asset / inventory label. Code 128 — densest alphanumeric without the GS1 overhead.
- Pharma / medical device. GS1 Data Matrix on the unit-dose package, GS1-128 on the carton, GS1 Digital Link QR if you also need a consumer-facing scan.
- Document or ID. PDF417 for fixed-format US documents (drivers licences, BCBP boarding passes); Aztec for ticket-style screens; QR for anything else.
- Marketing / consumer engagement. QR with a regular URL or a GS1 Digital Link.
Identifying an unknown barcode
Sometimes you have the printed value but not the format — a row in a supplier CSV, an OCR'd scan, a screenshot from a colleague. A few visual and structural cues narrow it down quickly:
- Pure 12–14 digits → almost certainly a GTIN of some kind: UPC-A (12), EAN-13 (13) or ITF-14 (14). Validate the trailing check digit with the GTIN Validator.
- 13 digits starting with 978 or 979 → ISBN-13.
- 13 digits starting with 977 → ISSN.
- Alphanumeric with bracketed groups like
(01)…(10)…→ GS1 Application Identifier syntax — either GS1-128 (1D) or GS1 Data Matrix (2D). - A URL starting with
https://id.gs1.org/or a brand's resolver — a GS1 Digital Link inside a QR or Data Matrix. - Mixed-case ASCII with hyphens and a length over 14 → most likely Code 128 (or GS1-128 if it starts with FNC1).
- All uppercase, no lowercase → could be Code 39 if it's from an older industrial / defence workflow.
Paste the value into the Barcode Type Detector and it will run the same heuristics for you in one click:
Identify the most likely 1D or 2D symbology behind a raw printed value.
If the value turns out to be GS1-formatted, the GS1 Digital Link Decoder parses the AIs (GTIN, batch, expiry, serial) into a structured breakdown.
Common mistakes
- Treating QR as a synonym for "any 2D barcode". Data Matrix is its industrial cousin and is usually the right answer for tight pharma / electronics packaging where QR is too large.
- Encoding a URL into a 1D barcode. Capacity collapses long before you fit it. Switch to a QR or use a GS1 Digital Link for retail.
- Mixing Code 39 and Code 128 in the same workflow without telling the parser. Both decode cleanly, but each has different escape rules for spaces and symbols.
- Printing ITF-14 at a module size below the GS1 minimum for the substrate. Cardboard ink bleed eats the fine bars; the symbol fails the print-grade check.
- Removing the 1D EAN the moment a 2D QR is added. Retail POS isn't fully Sunrise-ready yet; the till still needs the 1D barcode in most lanes through 2027.
- Reusing an EAN-8 allocation for a longer product line. EAN-8 is a separate GS1 allocation, not a truncated EAN-13. You have to apply for a new EAN-13 allocation if you outgrow the short form.
Quick decision guide
When you only need the practical answer for a single label, four short rules cover most cases:
- Consumer pack → EAN-13 (or UPC-A in North America) + an optional QR Digital Link for Sunrise readiness.
- Logistics carton or pallet → ITF-14 on the case, GS1-128 on the pallet (SSCC plus AIs).
- Pharma / healthcare unit-dose → GS1 Data Matrix encoding GTIN + batch + expiry.
- Document, ticket or boarding pass → PDF417 for fixed-format US documents, Aztec for European rail / transport, QR for everything else.
For round-trip QA after you've generated a symbol, scan it back with the Online Barcode Reader, validate any GTIN inside it with the GTIN Validator, and parse any GS1 payload with the GS1 Digital Link Decoder. For large batches, the Batch Barcode Tools page validates a pasted list in one pass.
Frequently asked
How do I tell what barcode format I'm looking at?
Count the digits and look at the shape. Two stacked groups of parallel bars with 12–13 digits → UPC-A or EAN-13. A wider Code 128 has variable-width bars and no digit grouping. A square matrix of dots is QR or Data Matrix; a tall narrow stack of rows is PDF417. Our Barcode Type Detector identifies a pasted value automatically.
Which barcode format should I print on consumer packaging?
EAN-13 (or UPC-A in North America) for the GTIN, plus — increasingly — a 2D code (QR or GS1 Data Matrix) for batch, expiry and a Digital Link URL. That dual-carrier approach is exactly what GS1 Sunrise 2027 is preparing the industry for.
Can I encode my website URL in a barcode?
Yes — that's exactly what QR codes are designed for. Don't try to fit a URL into a 1D barcode; capacity is far too low. For GS1-aware tracking, encode the URL as a GS1 Digital Link so retail systems can extract the GTIN from the same scan.
Why is ITF-14 used on cases instead of EAN-13?
ITF-14 (Interleaved 2 of 5, 14 digits) is more tolerant of direct-print on corrugated cardboard, where ink can spread and ruin the fine bars of an EAN-13. It encodes the GTIN-14 of the case (the consumer GTIN with an indicator digit).
Are PDF417 and Aztec still relevant?
Yes, in specific niches. PDF417 is mandated on the back of US driver's licences and many airline boarding passes. Aztec is heavy on European rail tickets. Neither is a good general-purpose choice today — QR and Data Matrix have won that battle.
What's the difference between Code 128 and GS1-128?
Same symbology, different rules. GS1-128 is Code 128 with a mandatory FNC1 character at the start that signals the payload follows GS1 Application Identifier syntax. The bars look identical; the parsing on the other end is stricter.
References
- GS1 General Specifications — the canonical document covering UPC, EAN, GS1-128, GS1 Data Matrix, ITF-14 and the Application Identifier syntax. Published by GS1.
- GS1 EAN/UPC barcodes — overview of the retail 1D family: gs1.org/standards/barcodes/ean-upc.
- ISO/IEC 16022 (Data Matrix) and ISO/IEC 18004 (QR Code) — the international standards behind the two dominant 2D formats. Available from the ISO catalogue.
Ready to generate any of these symbologies? The Barcode Generator covers the 1D family; QR Code, Data Matrix, PDF417 and Aztec live on dedicated pages.