Skip to main content
Guide

1D vs 2D Barcodes: When To Use Each

Capacity, scanner support, packaging footprint and the GS1 Sunrise-2027 migration story.

By ReadBarcode 6 min read Published 21 May 2026

A pharmacy shipment arrives with two barcodes on every carton. The till scanner reads the EAN-13 across the bottom and rings up the right product. The second symbol — a small black-and-white square next to it — carries the batch and expiry, but the scanner doesn't register it at all. The shipment goes through, the batch data never lands in the system, and a year later a recall traces back to a different wholesaler with no way to confirm which units were affected.

That is the practical difference between 1D and 2D barcodes. The bars on the side of every retail pack are a 1D barcode — they encode a single number along one axis. The squares of dots (QR codes, Data Matrix codes, PDF417, Aztec) are 2D barcodes — they pack a real payload of data into a matrix of modules. The difference between 1D vs QR code isn't really about QR; it's about how much information a symbol can hold and what kind of scanner it takes to read it. This guide walks through capacity, scanner support, when each one earns its place, and the GS1 Sunrise 2027 migration that's pushing 2D onto consumer packs by the end of the decade.

The short answer

A 1D barcode encodes a number along a single horizontal axis. A 2D barcode encodes a payload — text, a URL, structured GS1 data — across a square or rectangular matrix. The 2D form is denser and carries error correction, so it survives partial damage that would break a 1D scan. Modern phone cameras read both; older laser scanners typically read only 1D.

1D · EAN-13
EAN-13 (1D)5012345678900
Example EAN-13 encoding the GTIN-13 5012345678900 as parallel vertical bars along one axis.

13-digit identifier encoded as parallel bars. Reads at retail POS.

2D · QR Code
QR Code (2D)https://id.gs1.org/01/05012345678900/10/ABC123/17/261231
Example QR encoding a GS1 Digital Link URL with the same GTIN plus batch (10/ABC123) and expiry (17/261231).

Same identifier embedded in a GS1 Digital Link URL — phones open it as a web page.

1D vs 2D at a glance

The big differences between 1D and 2D barcodes line up neatly when you put them next to each other. Use this as the quick-reference table; the rest of the guide unpacks each row in context.

Side-by-side comparison of 1D and 2D barcodes: shape, capacity, error correction, scanner type, footprint and typical use case.
Aspect1D barcodes2D barcodes
ShapeParallel vertical bars along one axisSquare or rectangular matrix of modules
Common formatsUPC-A, EAN-13, EAN-8, Code 128, Code 39, ITF-14QR Code, Data Matrix, PDF417, Aztec
Typical capacity8–13 digits (retail), up to ~80 characters (Code 128)Hundreds to thousands of characters
Error correctionCheck digit only (typo detection)Reed–Solomon up to ~30% module loss
Scanner typeLaser line or imagerImager only (cameras count)
FootprintWide, short — needs label widthSquare — works on small or narrow packs
Where you see itRetail POS, parcels, library books, basic logisticsPharma traceability, boarding passes, consumer Digital Link, IDs

How they actually differ

A 1D barcode is a one-dimensional language: each bar and gap has a width that encodes a digit or character. A scanner draws an imaginary horizontal line across the symbol and reads the widths in order. That works beautifully for short identifiers — twelve or thirteen digits, the lifetime of every UPC-A or EAN-13 — but it runs out of room very quickly. Push past about eighty characters in Code 128 and the barcode is too long to print on most labels, never mind to scan reliably.

A 2D barcode flips the geometry. Instead of one axis, the data is distributed across a matrix of light and dark modules, plus a set of finder and timing patterns that tell the scanner how the symbol is oriented. That second axis is worth orders of magnitude in capacity: a small Data Matrix can hold a hundred characters in the same footprint as a five-digit number on a 1D code; a full QR Code can carry thousands of characters and a long URL.

The other thing the matrix layout buys you is error correction. 2D symbologies use Reed–Solomon codes to repair up to roughly 30% of the symbol if it's smudged, scratched or partially obscured — the same maths that lets a phone scan a QR code even when a hand or a coffee stain covers a corner. 1D barcodes have a single trailing check digit, which catches the most common typing errors but doesn't actually rebuild damaged bars.

2D · Data Matrix
Data Matrix (2D)(01)05012345678900(10)ABC123(17)261231
GS1 Data Matrix carrying a GTIN, batch and expiry in a footprint that fits on a vial cap.

Compact 2D — dominant in pharma, healthcare and component marking.

2D · PDF417
Code 128 (1D, for contrast)PDF417_demo_payload
Same ~20 characters as Code 128 (1D) for visual contrast — note how much horizontal space a 1D symbol needs even for short data.

Stacked 2D — used on driver's licences and shipping labels.

When 1D is still the right answer

The 2D-everywhere story sometimes oversells the case. There are workflows where a plain 1D barcode is still cheaper, faster and entirely sufficient:

  • Retail point-of-sale on a fixed product. The till already knows the GTIN maps to a price and a description; an EAN-13 or UPC-A is the fastest scan in that loop. Adding a 2D code there doesn't make the till faster — it just adds artwork.
  • Legacy supply chains running laser-only fleets. Many warehouse scanners, library check-out machines and self-service kiosks are 1D-only. As long as that hardware is in the loop, 1D has to stay on the label.
  • Narrow labels. A Code 128 fits well on a long thin label (cable wrap, archival spine, hospital wristband). A 2D code on the same strip is either too small to scan reliably or wastes the width.
  • Wedge-scanner workflows. Office scanners that emulate keyboard input (the "USB wedge") often work best with simple 1D symbologies piped straight into a text field.

If you're generating new 1D codes — for cartons, parcels or internal inventory — the Barcode Generator covers UPC, EAN, Code 128, Code 39 and ITF-14. For carton-level shipping labels with bearer bars, see the ITF-14 Carton Label Generator.

When 2D earns its place

A 2D code earns its place whenever a single identifier isn't enough — when you need to carry the GTIN plus the batch, the expiry, the serial, or a URL the shopper can scan with their phone. Four scenarios cover most of it:

  • Track-and-trace regulations. Pharma, tobacco, medical devices and increasingly food categories require batch and expiry encoded on every saleable unit. A 1D EAN can't fit that; a GS1 Data Matrix can.
  • Consumer engagement with no app. A QR code carrying a GS1 Digital Link URL behaves as a normal URL when scanned by a phone — opens the product page, recipe, allergen list or warranty form. Same code, scanned at the till by an upgraded POS, also returns the GTIN.
  • Tight packaging where a 1D wouldn't fit. A square 2D symbol scales down further than the equivalent 1D before quality drops below the printable grade. That matters on cosmetics, blister packs and small component reels.
  • Documents and IDs. Driver's licences, boarding passes and shipping manifests all use 2D codes (PDF417, Aztec, Data Matrix) to carry structured data that's read by a single camera scan.

If you receive a 2D payload and want to see what's inside, the GS1 Digital Link Decoder parses both the URL form and the raw bracketed AI form ((01)…(10)…(17)…) and shows each Application Identifier expanded into its meaning. Try it with the same payload that's encoded into the QR code above:

GS1 Digital Link Decoder

Parse a GS1 Digital Link URL or raw AI string into structured GTIN + batch + expiry data.

Decode the worked example

To generate your own 2D codes for proofing, use the QR Code Generator for consumer-facing payloads, the Data Matrix Generator for compact industrial use, or the GS1 Digital Link Generator for a Sunrise-ready dual-purpose code.

Sunrise 2027 and dual carriers

GS1 Sunrise 2027 is the global commitment that retail point-of-sale scanners will accept 2D codes (a QR carrying a GS1 Digital Link, or a GS1 Data Matrix) alongside the traditional 1D UPC and EAN by the end of 2027. It is the formal acceptance that one symbol on the front of a consumer pack should carry both the GTIN that the till needs and the structured data (batch, expiry, serial, URL) that the shopper and the supply chain need.

For the full timeline, the equipment audit checklist and the practical migration path, see the Sunrise 2027 Guide.

Scanner support

Whether a given scanner reads 1D, 2D or both comes down to its imaging hardware rather than its age:

  • Laser scanners — the original supermarket scanner shape, a single thin red line — read 1D codes only. They're cheap, fast on a fixed product, and still dominant in legacy POS lanes.
  • Imager scanners — a red illumination rectangle, often with a visible aiming dot — capture a 2D image of the symbol and decode it in firmware. They read every 1D format too, so an imager is a strict superset of a laser.
  • Phone cameras on modern iOS and Android handsets read both 1D and 2D natively in the camera app — no third-party app required for the common formats.

To test what a given device reads in practice, scan a sample with the Online Barcode Reader (auto-detects 1D and 2D), or use the format-specific QR Code Reader and Data Matrix Reader when you know the symbology.

Common mistakes

The same misjudgements come up over and over when teams first add 2D to a 1D workflow:

  • Treating QR as a generic 2D format for retail. A plain marketing URL inside a QR doesn't carry the GS1 identifiers that a Sunrise-ready POS expects. Encode a GS1 Digital Link URL instead so the same code works at the till and on the phone.
  • Shrinking a 2D code below its minimum module size. 2D codes need a print grade above a minimum to scan reliably. Compressing one to fit a small label kills the error-correction budget and the symbol fails on cheap scanners first.
  • Removing the 1D barcode the moment the 2D one is added. Retail POS isn't fully 2D-ready yet. Run dual carriers until your top retailer partners certify their scanners — usually well after Sunrise 2027.
  • Forgetting the FNC1 prefix on a GS1 Data Matrix. A GS1 Data Matrix needs the FNC1 leading modifier so downstream parsers recognise it as GS1 — without it, the same string is treated as a plain Data Matrix and the Application Identifiers don't parse.
  • Assuming every phone scans every format. Older Android camera apps don't handle Data Matrix or PDF417 natively. Test on the device classes your shoppers actually carry, not the latest flagship.

Quick decision guide

If you only need the practical answer for a new label or pack, the rules collapse to four short ones:

  • Use a 1D barcode when the receiving scanner is laser-based, when the data is a fixed identifier (GTIN, ISBN, internal SKU), and when label real estate runs horizontally.
  • Use a 2D barcode when you need to carry a payload beyond a single number — batch, expiry, serial, a URL — or when the packaging is too small for a usable 1D symbol.
  • Run both carriers on consumer packs through the Sunrise 2027 transition: a 1D EAN-13 for the till, a 2D QR with a GS1 Digital Link for the phone and the supply chain.
  • Validate before printing. Decode every 2D payload with the GS1 Digital Link Decoder and check each 1D check digit with the GTIN Validator.

Frequently asked

What's the actual difference between a 1D and a 2D barcode?

A 1D barcode encodes data along a single horizontal axis using vertical bars of varying width. A 2D barcode encodes data in a square or rectangular matrix of modules, using both axes. The matrix layout gives 2D codes far more capacity in the same physical footprint, plus built-in error correction.

Is a QR code a 2D barcode?

Yes. QR (Quick Response) is one of several 2D matrix symbologies, alongside Data Matrix, Aztec and PDF417. Whenever someone says 'barcode vs QR code', they really mean 1D vs 2D — QR is just the most familiar 2D format because of phone cameras.

Are 2D barcodes always better?

Not at retail point-of-sale. For a fixed product where the till only needs the GTIN, an EAN-13 or UPC-A is the fastest, most reliable scan. 2D wins when you need to encode batch, expiry, serial number or a consumer URL alongside the GTIN — which is exactly what GS1 Sunrise 2027 is pushing for on consumer packs.

Can my phone read 1D barcodes?

Modern iOS and Android cameras read most 1D formats (EAN, UPC, Code 128, Code 39) and every common 2D format (QR, Data Matrix, PDF417, Aztec). Older phones and embedded scanners may be limited to a subset — always test with the device class your customers actually use.

Why does GS1 prefer Data Matrix over QR for healthcare?

Data Matrix achieves the same data density at smaller print sizes, which matters on vials, surgical instruments and unit-dose packaging. QR is favoured for consumer-facing applications where the symbol is bigger and phones are the primary scanner.

Will I need to replace my 1D barcode equipment?

Probably, but gradually. Most older laser scanners are 1D-only. Imager-based scanners (the ones with a red illumination box rather than a single line) handle both. Audit your fleet before Sunrise 2027 and prioritise high-traffic lanes for the upgrade.

References

  • GS1 General Specifications — the canonical document defining EAN/UPC, GS1 Data Matrix and the Application Identifier syntax. Published by GS1.
  • GS1 Sunrise 2027 programme — overview of the global 2D-at-POS commitment and its milestones: gs1.org/standards/2d-at-pos.
  • GS1 Digital Link — the URL form that lets a single 2D symbol serve both the point-of-sale scanner and the shopper's phone: gs1.org/standards/gs1-digital-link.

For a side-by-side reference of every 1D and 2D symbology you're likely to meet, see the barcode formats field guide. For the full Sunrise 2027 timeline and equipment audit, see the dedicated Sunrise 2027 Guide.

Next read

More guides