A traditional barcode is one-dimensional: a row of stripes read across, holding a 12 or 13 digit product number and nothing else. A QR code is two-dimensional: a grid read in both directions, holding thousands of characters. The practical difference is where the information lives. A barcode is a lookup key, useless without the database behind it, while a QR code carries the actual link, network or contact details inside the pattern.
That’s also why the checkout scanner at a supermarket shows a price you can’t see in the stripes, and why your phone can join a Wi-Fi network from a QR code with no connection at all.
Side by side #
| 1D barcode (UPC, EAN) | QR code | |
|---|---|---|
| Shape | A strip of stripes | A square grid |
| Typical contents | A 12 or 13 digit product number | A link, Wi-Fi login, contact card or text |
| Capacity | Around 12 to 13 digits for retail codes | Up to 7,089 digits, or about 3 KB |
| Needs a database | Yes, for anything human-readable | No |
| Read direction | Across the stripes, roughly aligned | Any angle, 360 degrees |
| Damage tolerance | A check digit catches misreads, nothing is rebuilt | Error correction rebuilds 7% to 30% |
| Usual reader | Laser or imaging scanner at a till | Any phone camera |
| Shape on the package | Wide and short | Compact square |
| Cost to use | A GS1 company prefix, which carries a fee | Free, no license needed |
What’s actually inside a supermarket barcode #
A UPC-A barcode holds 12 digits. GS1 US, which issues them, describes that number as the GTIN that identifies the product, made up of a company prefix, an item reference and a check digit. EAN-13, the international equivalent, carries 13 digits on the same principle.
The barcode says which product this is. It doesn’t say what the product is called, what it costs or how many are in stock. All of that is looked up in the retailer’s own system the moment the number is scanned, which is exactly why a general barcode scanner app on your phone shows you a bare number: you have the key, but not the shop’s database. Barcode scanner apps covers what the good ones do about that.
Other 1D formats exist for other jobs. Code 39 and Code 128 handle letters as well as digits and turn up on shipping labels, warehouse shelves and ID badges. They hold a few dozen characters at most, and get physically wider with every character added, which is the fundamental limit of stripes.
What’s inside a QR code #
Text, stored in a grid that a scanner locates using the three big squares in the corners. That text can be a whole web address, a network name and password, a contact card or a paragraph, and the phone acts on it directly. How QR codes work goes through the mechanics, and how much data a QR code can hold covers the limits.
Two properties follow from being two-dimensional. Data density goes up sharply, because information is packed in both directions instead of one. And error correction becomes practical, so a QR code survives being creased, scratched or partly covered while a damaged barcode simply fails.
Is a QR code a barcode? #
Yes, in the technical sense. “Barcode” covers any machine-readable optical label, and a QR code is a 2D barcode. In everyday speech, “barcode” means the striped retail kind and “QR code” means the square one, which is the usage this article follows.
The other 2D codes you’ll meet:
- Data Matrix: small square codes on electronic components, surgical instruments and medicine packaging, where space is tight.
- PDF417: a stack of narrow rows, used on driver’s licenses, boarding passes and shipping labels. It holds more than a 1D code and is often scanned by laser equipment.
- Aztec: a square code with a bullseye in the middle, common on train tickets and some boarding passes because it reads well off a phone screen.
When to use which #
Use a retail barcode when you’re selling a physical product through shops that scan at a till. You don’t get a choice here: retailers need a GTIN, and GS1 assigns the company prefix behind it. Check GS1’s current fees before budgeting for one.
Use a QR code when you want a phone to do something: open a page, join a network, save a contact, start a message, show a ticket. Nobody needs your database, and no special hardware is involved.
Both on the same package is common and sensible. The stripes are for the till, the square is for the customer’s phone.
Retailers keep using 1D codes because the equipment is everywhere, laser scanners read them fast at awkward angles, and the database model works. Replacing the barcode on a product means every till that sells it has to cope with the change, which is a slow thing to coordinate across an industry.
Can one phone read both? #
Mostly. iPhone and Android cameras read QR codes on their own, and support for retail barcodes varies by phone and app: Google Lens handles common product codes, while the iPhone Camera app’s barcode support is narrower than its QR support.
QR Handler reads both families in one scanner: QR codes, and EAN-13, EAN-8, UPC-A, UPC-E, Code 39, Code 93, Code 128, Codabar, ITF-14, Aztec, Data Matrix and PDF417. For a retail barcode it shows the number and offers a Search product button that runs a web search for it, which is the honest version of a product lookup when you don’t have a store’s database. Scans go to a history on the device, so you can compare numbers later without writing them down.
Frequently asked questions #
Which holds more data, a QR code or a barcode? #
The QR code, by a wide margin. A retail barcode holds 12 or 13 digits. A QR code holds up to 7,089 digits or roughly 3 KB of text, because it packs data in two directions rather than one.
Can a QR code replace a UPC on a product? #
Not for checkout, in most shops today. Tills and their databases are built around the GTIN in a 1D barcode, so packaging normally carries the barcode for the till and a QR code for the shopper.
Why does my barcode scanner app only show a number? #
Because the number is all the barcode contains. Product names and prices live in a retailer’s database, so an app has to look the number up somewhere to tell you more, and general scanners often don’t.
Do QR codes and barcodes expire? #
Neither expires as a pattern. A retail barcode keeps working as long as the product number is registered to you, and a static QR code works as long as it can be scanned. What expires is what they point at, such as a dead website or a lapsed dynamic-code subscription. See do QR codes expire.
Are QR codes free to use, unlike barcodes? #
Yes. Denso Wave states that no application or license is needed to use QR codes, so you can generate as many as you like at no cost. A retail barcode requires a GS1 company prefix, which is a paid registration.