One dimension versus two
A traditional barcode — the striped symbol on a cereal box — is one-dimensional. All its information is in the widths of the bars and spaces along one line. You could slice it horizontally anywhere and still read the whole thing; the height only exists to make it easier to hit with a scanner.
A QR code is two-dimensional. It stores information both across and down, in a grid of square modules. That is the source of every difference that follows.
Side by side
| Linear barcode (EAN-13, UPC-A, Code 128) | QR code | |
|---|---|---|
| Dimensions | 1D: bars and spaces | 2D: square grid |
| Typical content | A product number or short ID | A URL, WiFi login, contact card, text |
| Capacity | EAN-13: 13 digits. Code 128: practical limit of a few dozen characters | Up to 7,089 digits or 2,953 bytes |
| Error correction | A check digit that detects, but cannot repair, errors | Reed–Solomon: repairs up to ~30% damage |
| Scanned by | Laser scanners, imagers, phone cameras with an app | Phone cameras natively; 2D imagers |
| Orientation | Must be roughly aligned with the scan line | Any angle |
| Space needed | Wide and short | Square |
| Main home | Checkouts, warehouses, logistics, libraries | Consumer engagement, marketing, payments, tickets |
What each is best at
Linear barcodes win where the infrastructure already exists. Nearly every checkout and warehouse handheld reads them, very fast, at the press of a trigger. For identifying a product by number, a 1D barcode is cheap, universal and entirely sufficient. The number points into a database; the barcode does not need to hold anything else.
QR codes win when a person with a phone is the scanner. Phone cameras read QR codes without an app, and a QR code can carry a full URL, so a scan can open a web page, join a WiFi network or save a contact. Their error correction also makes them more forgiving of damage, curved surfaces and poor print.
The convergence: 2D barcodes at the checkout
The line between the two is blurring. Retailers are moving to 2D-capable scanners that can read QR codes and GS1 DataMatrix at the till, and GS1 — the organisation behind EAN and UPC — has set out a plan, often called Sunrise 2027 in the US, for retail point-of-sale systems to accept 2D barcodes by the end of 2027.
The point is not to replace the product number but to carry more with it. A QR code using the GS1 Digital Link standard contains a web address that embeds the product's GTIN — and can add a batch number or expiry date. The checkout reads the GTIN as it would from a 1D barcode; a customer's phone opens a product page with ingredients, instructions or recall information. Our guide to GS1 Digital Link explains the format.
For now, retail products still need a linear EAN or UPC because many tills cannot read anything else.
Data Matrix: the other 2D code
Data Matrix is the main alternative 2D symbology. You can recognise it by the solid L-shaped border on two sides and the alternating "clock track" on the other two, instead of three corner squares.
- It packs small amounts of data into very little space, so it is the standard for marking tiny parts, electronic components and surgical instruments, often etched directly into metal.
- GS1 DataMatrix is used on pharmaceutical packaging in many countries to carry product codes, batch, expiry and serial numbers for anti-counterfeiting.
- Phone cameras read it less consistently than QR codes, so it is rarely used for consumer-facing codes.
Which should you use?
| Situation | Use |
|---|---|
| Product sold in shops | EAN-13 or UPC-A with a GS1-issued number — see the barcode generator |
| Customers should scan with their phone | QR code |
| Internal stock, assets, shelves, bins | Code 128 (or QR if staff use phones) |
| Shipping labels | GS1-128 from your shipping software |
| Very small parts, direct marking | Data Matrix |
| Product packaging that should also link to info online | Both: an EAN for the till plus a QR code, or a GS1 Digital Link QR once your retailers support it |
| Tickets, boarding passes | QR, Aztec or PDF417 — usually issued by the ticketing system |
Frequently asked questions
Is a QR code a type of barcode?
Yes — technically a QR code is a two-dimensional matrix barcode. In everyday use, "barcode" usually means the striped linear kind, such as EAN-13 and UPC-A.
Can a QR code replace a UPC or EAN barcode?
Not yet for most retail. Many checkout scanners still read only linear barcodes. Retailers are adopting 2D scanners, and QR codes using GS1 Digital Link are designed to replace them eventually, but products currently still need an EAN or UPC.
Why do QR codes hold more data than barcodes?
A linear barcode stores data in one dimension, so more data means a wider symbol. A QR code uses both dimensions, so its capacity grows with its area, reaching thousands of characters in the largest version.
Can a phone scan a regular barcode?
Often, yes. Google Lens and many shopping and scanner apps read EAN and UPC codes. The built-in iPhone camera focuses on QR codes, so a 1D barcode usually needs an app.
Which is cheaper, a barcode or a QR code?
Both are free to generate and cost the same to print. The cost for retail barcodes is the GS1 membership that issues valid product numbers. QR codes for URLs, WiFi or contacts need no registration at all.
Further reading
- Do QR codes expire? — A QR code itself never expires — but a dynamic code can die when a subscription ends. How to tell which kind you have, and how to get an editable code without the risk.
- GS1 Digital Link: QR codes on products, explained — How GS1 Digital Link puts a product's GTIN, batch and expiry into a QR code that both checkouts and phones can read, what Sunrise 2027 means for brands, and how to build one correctly.
- How QR codes work, from pattern to payload — A clear technical walkthrough of a QR code: the finder and timing patterns, how text becomes bits in each encoding mode, Reed–Solomon error correction, masking, and how a phone reads it.
- How to scan a QR code on any device — Scan QR codes with the built-in camera on iPhone and Android, from a screenshot or photo, on a Windows or Mac computer — and what to do when a code will not scan.