The quickest way to end the confusion: "2D barcode" is not a third kind of code. It is the umbrella term, and a QR code and a Data Matrix are two types of 2D barcode that sit under it. So the real question is not QR versus Data Matrix versus 2D barcode, it is which type of 2D barcode you should use, and for what.
The short version: a QR code is the large, robust, phone-friendly 2D code you see on consumer packaging; a Data Matrix is the compact 2D code used on small or regulated items like medicines and components; and both are 2D barcodes, as opposed to the old linear barcode you have scanned at tills for fifty years.
Is a QR code a 2D barcode?
Yes. A QR code is a type of 2D barcode. "2D barcode" describes any code that stores data in two dimensions, across a grid, rather than in the widths of parallel lines. QR codes and Data Matrix codes are both 2D barcodes; the striped UPC or EAN code on a can of beans is a 1D, or linear, barcode.
The reason people treat "2D barcode" as if it were its own code is that the retail industry uses the phrase as shorthand for the shift happening now: checkouts moving from 1D linear barcodes to 2D codes. When a GS1 document says a pack will carry a "2D barcode", it usually means a QR code or a Data Matrix, not some separate third format.
What is the difference between a QR code and a Data Matrix?
The core difference is size and audience. A QR code is larger, carries strong built-in error correction so it still scans when scuffed or partly covered, and is designed to be read instantly by any smartphone camera, which makes it the natural choice for consumer engagement. A Data Matrix is far more compact and can hold a useful amount of data in a few millimetres, which makes it the choice where space is scarce or the reader is an industrial scanner rather than a shopper's phone.
| Linear (1D) barcode | QR code | Data Matrix | |
|---|---|---|---|
| Type | 1D | 2D | 2D |
| Shape | Parallel lines | Square grid with three corner squares | Square grid with an L-shaped finder |
| Read with | Laser scanner | Any phone camera | Phone camera or industrial imager |
| Size on pack | Medium | Larger, consumer-visible | Very small, down to a few millimetres |
| Typical use | Retail checkout | Consumer packaging, marketing, compliance | Small items, medicines, electronics, direct-part marking |
Both are 2D, both hold far more than a linear barcode, and both can carry a GS1 Digital Link. The choice between them is mostly about how small the code has to be and who is going to scan it.

When should you use a QR code or a Data Matrix?
Use a QR code when a person will scan it and when you want the code to do more than compliance: consumer packaging, marketing, product passports, authenticity checks. Use a Data Matrix when the item is tiny or the scan is industrial: a medicine blister, a surgical instrument, a small electronic component, or a part marked directly onto metal.
- QR code: consumer goods, food and drink, cosmetics, anything where a shopper scans with a phone and you want engagement on top of identification.
- GS1 DataMatrix: pharmaceuticals and medical devices, small or curved surfaces, and regulated data that has to fit where a QR code physically will not.
For most brands preparing for retail's move to 2D and for the European Digital Product Passport, the answer is a QR code, because it is the one a customer can actually scan. For the full map of GS1 code formats beyond these two, see our guide on GS1 barcode formats.
Why is retail moving to 2D barcodes at all?
Retail is moving to 2D because a single 2D code can do at the till what the linear barcode does, and carry a web link, batch, expiry and compliance data on top. This is the transition the industry calls Sunrise 2027: checkouts worldwide becoming able to read 2D codes by the end of 2027, so one code can serve the checkout and the consumer at once.

A GS1 Digital Link QR code is what makes that dual role work. The same code rings up a sale like a barcode and, scanned by a phone, opens a product page, a passport or an authenticity check. That is why the consumer-facing side of the 2D transition is overwhelmingly QR, with Data Matrix staying in the places a phone was never going to scan.
Frequently asked questions
Is a 2D barcode the same as a QR code?
Not quite. "2D barcode" is the umbrella term for codes that store data in a grid; a QR code is one type of 2D barcode, and a Data Matrix is another. Every QR code is a 2D barcode, but not every 2D barcode is a QR code.
Can a phone scan a Data Matrix code?
Modern phone cameras can read many Data Matrix codes, but Data Matrix is optimised for industrial imagers and very small surfaces, while QR codes are designed for effortless phone scanning. If the audience is consumers, a QR code is the safer choice.
Which 2D barcode does GS1 recommend for retail?
For consumer retail and the shift to 2D at the point of sale, the consumer-facing code is a QR code carrying a GS1 Digital Link. GS1 DataMatrix remains common for healthcare and small regulated items.
Is a linear barcode a 2D barcode?
No. A linear, or 1D, barcode such as UPC or EAN stores data in the widths of parallel lines. A 2D barcode stores data across a two-dimensional grid, which is why it holds much more.





