1D vs 2D Barcodes: Key Differences Explained
1D vs 2D barcodes compared: how much data each holds, error correction, scanner needs, print size and cost, with clear advice on when to use each type.
By StylQR Editorial TeamPublished 4 min read

Table of contents
The difference between 1D and 2D barcodes is how they store data. A 1D (linear) barcode encodes a short string, usually 8 to 20 characters, in the widths of vertical bars read along one line. A 2D barcode stores data across a grid of cells, so it holds hundreds or thousands of characters in a small square and can survive damage.
That trade-off shapes everything else: which scanner you need, how big the code is, and what it's good for. Here's the comparison in detail.
Side-by-side comparison
| 1D barcodes | 2D barcodes | |
|---|---|---|
| Examples | EAN-13, UPC-A, Code 128, Code 39, ITF-14 | QR code, Data Matrix, PDF417, Aztec, MaxiCode |
| How data is stored | Bar and space widths, one direction | Pattern of cells in two directions |
| Typical capacity | A product number or ID of up to a few dozen characters | Up to thousands of characters |
| Error correction | None; a check digit only detects errors | Reed-Solomon error correction rebuilds damaged parts |
| Scanners | Laser, linear imager, 2D imager, phone | 2D imager or phone camera |
| Reading angle | Scan line must cross every bar | Any rotation |
| Space needed | Wide strip | Compact square or rectangle |
| Typical uses | Checkout, cartons, asset tags | Medicines, electronics parts, tickets, links, ID cards |
How much each can hold
A 1D barcode grows wider with every character. An EAN-13 always holds 13 digits. Code 128 can technically be longer, but beyond a few dozen characters it gets too wide to fit on a label or to scan in one pass.
2D codes add data by adding cells, not width. At their largest sizes:
- QR code: up to 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes, according to Denso Wave.
- Data Matrix: up to 3,116 digits, 2,335 alphanumeric characters or 1,556 bytes in its largest 144 × 144 square.
- PDF417: up to about 1,100 bytes or 1,850 text characters, which is why it's used for ID card data.
In practice you rarely fill a 2D code. The point is that it holds a GTIN plus batch, expiry and serial number in a square a few millimeters wide, which a 1D code can't. How much data a QR code can store goes into the practical limits.
Damage and error correction
A 1D barcode's check digit only tells the scanner that something went wrong. If bars are smudged, the scan fails, although a scan line through an undamaged part of the bars may still work.
2D codes include Reed-Solomon error correction. A QR code at level H can restore about 30% of its data; Data Matrix (ECC 200) also rebuilds damaged areas. That makes 2D codes the choice for parts that get scratched or for codes etched directly onto metal or plastic, called direct part marking.
Scanners: the practical hurdle
This is usually the deciding factor.
- Laser scanners sweep a beam across the bars. They read 1D codes only. Many supermarket checkouts still use them, often in multi-line patterns to read from any angle.
- Linear imagers take a one-line picture with a sensor. Also 1D only.
- 2D area imagers take a full picture, like a camera, and decode any code in it. They read 1D and 2D.
- Phones are 2D imagers. With a suitable app they read both families.
So if your customer, warehouse or retailer still runs laser scanners, a 2D code alone won't work for them. Stacked codes like PDF417 can be read by some rastering laser scanners, but QR and Data Matrix need an imager. How supermarkets scan barcodes explains the checkout side.
Where retail is heading
GS1 US's Sunrise 2027 initiative asks retailers to install scanners that can read 2D codes such as QR codes with GS1 Digital Link and GS1 DataMatrix, and to extract the GTIN from them at checkout. A 2D code can then carry the product number plus batch and expiry dates for recalls and stock rotation, and also open a web page for shoppers.
That doesn't remove the UPC or EAN overnight. Packs will carry both during the changeover. GS1 Sunrise 2027 covers the timeline, and preparing for 2D barcodes covers what brands should do now.
When to use each
Use a 1D barcode when:
- The scanner on the other end might be a laser (retail checkouts, older warehouses).
- You only need a product number or ID.
- A standard requires it: EAN-13 or UPC-A at retail, ITF-14 or GS1-128 on cartons.
Use a 2D barcode when:
- Space is tight, such as on small electronics components, vials or jewellery tags.
- You need several fields in one code: GTIN, batch, expiry, serial number.
- The code may be scratched, curved or etched onto metal.
- People will scan it with phones, as with links or tickets.
Making either type
The Data Matrix generator makes square ECC 200 codes, with a separate rectangular Data Matrix page for narrow labels; the GS1 DataMatrix generator includes an Application Identifier helper for GTIN, batch and expiry. For 1D codes, types of barcodes explained helps you pick the right one, and the main barcode generator covers every format with exact-size PDF and SVG downloads.
Frequently asked questions
Is a QR code a 2D barcode?
Yes. QR codes are the best-known 2D barcode. Data Matrix, PDF417, Aztec and MaxiCode are other common 2D types.
Are 2D barcodes more expensive to print?
Not usually. Any printer that can produce a sharp 1D barcode can print a 2D code at a suitable size. The cost difference is mostly in scanners, since laser models need replacing with imagers.
Can a phone read 1D barcodes?
Yes, with the right app. Phone cameras are imagers, so they can decode both 1D and 2D codes, though built-in camera apps focus mainly on QR codes.
Will 1D barcodes be phased out?
Not on a fixed date. GS1 US's Sunrise 2027 initiative aims for retail checkouts to read 2D codes, and products are expected to carry both types during the transition.


