1D barcodes encode data in vertical lines read horizontally, while 2D barcodes such as QR codes store far more data in a two-dimensional grid.
1D and 2D barcodes are the two families of machine-readable code printed on packaging, tickets, and asset labels. A 1D (linear) barcode encodes a short string of data in the widths of parallel vertical bars, read in a single horizontal pass; a 2D (matrix) barcode such as a QR code or Data Matrix encodes data in both directions across a grid of small modules, which lets it hold far more information in the same space. Both exist to do the same job: turn a printed identifier into data a barcode scanner or phone camera can capture without anyone typing.
How 1D barcodes work
A 1D barcode is the classic stripe pattern: think of the EAN or UPC code at a supermarket till, or Code 128 and Code 39 labels in a warehouse. All of the data lives in the horizontal sequence of bar and gap widths - the height adds nothing except tolerance for a sloppy scan line.
That design has two consequences. Capacity is small: a practical 1D code carries a short number or reference, because every extra character makes the label physically wider. And the code almost never contains the information itself - it carries a lookup key, typically a UID that points to a record in a database.
How 2D barcodes work
A 2D barcode arranges data across a grid, so capacity grows with area rather than width - thousands of characters fit in a small square, enough to encode a complete URL rather than just a reference number. Finder patterns (the corner squares on a QR code) let the reader locate and orient the code, so it scans upside down or at an angle. Built-in error correction means a partly damaged code still reads.
Common 2D formats include the QR code (the general-purpose choice, readable by any phone camera), Data Matrix (very compact, used for marking electronics and industrial parts), PDF417 (the stacked format on boarding passes and many driving licences), and Aztec (transport tickets).
Key differences at a glance
- Capacity - 1D holds a short reference; 2D holds hundreds to thousands of characters, including full URLs.
- Scanning hardware - 1D reads with cheap laser scanners; 2D needs an imager or camera, which every smartphone already has.
- Damage tolerance - 2D codes carry error correction; 1D codes generally fail once the bars are scratched or smudged.
- Orientation - 2D scans at any angle; 1D needs the scan line to cross all the bars.
- Footprint - 2D stores more data in less label space, which matters on small items.
When to use which
1D barcodes still make sense where they are entrenched: retail point of sale, conveyor lines, and warehouses already full of laser scanners reading simple numeric keys. 2D barcodes win when the scanner is a phone, when the label must encode a link, when label space is tight, or when labels take abuse - a tag on safety equipment that gets scuffed in a van will keep scanning as a QR code long after a linear barcode has given up.
1D vs 2D in asset tracking
For tracking equipment, the deciding factor is usually hardware: a 2D code turns every phone in the building into a reader, while a 1D code assumes dedicated scanners. That is why modern asset systems standardise on QR labels - in AMPthilly, for example, each asset gets a printable QR label that opens its record in the browser when scanned with a normal phone camera, with no app or scanner hardware involved. Whichever format you choose, print the identifier in human-readable text beneath the code, so a damaged label can still be matched to its record by eye.
Related terms
- Barcode Scanner - the hardware and software that reads both code families
- Label Printer - how barcode and QR labels are produced in volume
- UID (Unique Identifier) - the value most barcodes actually encode
- VIN (Vehicle Identification Number) - the standardised identifier barcoded on vehicle stickers
- IMEI - the unique identifier behind the barcode on a phone’s box