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.
The short version: 1D codes are width-limited and carry a lookup key; 2D codes pack thousands of characters into a small square, scan from any angle, and survive damage. With the retail world now migrating to 2D at the checkout under GS1 Sunrise 2027, the gap matters more in 2026 than it ever has.
What you will learn
- How 1D barcodes work
- How 2D barcodes work
- Common 1D and 2D barcode types (with examples)
- How to tell a 1D barcode from a 2D barcode
- How much data each barcode type holds
- Key differences at a glance
- What hardware reads each type
- QR code vs Data Matrix: choosing a 2D format
- How to print 2D codes
- GS1 Sunrise 2027: the shift to 2D at checkout
- GS1 2D codes and traceability in construction
- When to use which
- 1D vs 2D in asset tracking
- FAQ
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. Scan a UPC at a till and the number does nothing on its own; the point-of-sale system looks it up to find the product, price, and description.
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.
That error correction is not vague redundancy - it is specified. QR codes (governed by ISO/IEC 18004) offer four correction levels, L, M, Q, and H, recovering roughly 7%, 15%, 25%, and 30% of the code respectively; at the highest level the symbol still decodes with damage to about a third of its area. Data Matrix (ISO/IEC 16022) uses Reed-Solomon error correction for similar resilience. This is why 2D codes survive the scuffs, smudges, and partial tears that would kill a linear barcode.
Common 1D and 2D barcode types (with examples)
“Barcode” is a family, not a single format. Here are the types you will actually meet, grouped by family.
1D (linear) barcode examples:
- UPC / EAN - the retail product codes on almost everything you buy at a store.
- Code 128 - dense, high-capacity logistics and shipping labels; the GS1-128 variant carries structured supply-chain data.
- Code 39 - an older industrial format still common on asset tags and ID badges.
- Interleaved 2 of 5 (ITF) - numeric codes printed on shipping cartons and cases.
- Codabar - used by libraries, blood banks, and photo labs.
- GS1 DataBar - compact codes used on coupons and fresh produce.
2D (matrix) barcode examples:
- QR Code - the general-purpose, phone-readable code; great for URLs and consumer-facing labels.
- Data Matrix - very compact; the go-to for direct-part marking on electronics and surgical instruments, readable down to a few millimetres.
- PDF417 - the tall stacked code on boarding passes, driving licences, and shipping documents.
- Aztec - common on rail and transit tickets; it needs no surrounding quiet zone, so it fits tight layouts.
- MaxiCode - the fixed-size code used for high-speed parcel sortation.
One nuance most pages get wrong: PDF417 is technically a “stacked linear” format, not a true matrix code. It stacks several short linear rows on top of each other rather than encoding freely in two dimensions, so it sits between the two families - more capacity than a single 1D row, but read row-by-row rather than as a single grid.
How to tell a 1D barcode from a 2D barcode
The quickest test is visual. A 1D barcode is a row of parallel vertical bars of varying width, read along a single horizontal axis - the supermarket stripe. A 2D barcode is a square or rectangular grid of dots or modules read on both axes at once, and it almost always carries locator marks: three corner squares on a QR code, or a solid L-shaped border on a Data Matrix.
The rule of thumb that never fails: if you can scan it by pointing your phone camera at it from any angle and it just works, it is almost certainly a 2D code. If it only reads when a scan line crosses straight across the bars, it is 1D.
How much data each barcode type holds
Capacity is the single biggest practical difference, and it comes down to geometry: a 1D code grows in one dimension (width), so each extra character makes the label wider, while a 2D code grows in two dimensions (area), so adding data fills in the grid without ballooning the footprint.
- UPC - exactly 12 digits.
- Code 128 - up to roughly 48 characters, though in practice most 1D codes stay under 20-25 characters before the label becomes unwieldy.
- QR Code - up to about 7,089 numeric, 4,296 alphanumeric, or 2,953 binary characters.
- Data Matrix - up to about 2,335 alphanumeric characters, in a far smaller footprint than QR.
This is exactly why a 1D barcode carries only a lookup key - a serial number or product reference that points to a database record - while a 2D code can carry a full URL, a structured data string, or an entire asset record in the symbol itself.
Key differences at a glance
- Capacity - 1D holds a short reference (UPC: 12 digits; Code 128: ~48 characters); 2D holds thousands (QR: ~7,089 numeric; Data Matrix: ~2,335 alphanumeric), 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 specified error correction (QR levels L/M/Q/H); 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.
What hardware reads each type
Which code you can use depends on what is going to read it. There are three broad reader classes:
- Laser scanners sweep a single line of light across the symbol. They are the cheapest option, but they read 1D only.
- Linear / CCD imagers capture a one-dimensional strip of the image. Still 1D only, but more forgiving than a laser at close range.
- 2D area imagers and cameras photograph the whole symbol and decode the grid. These read both families - every 1D and 2D code - which is why most modern handheld scanners are 2D imagers.
The point that matters most for everyday workflows: phone cameras read 2D and QR codes natively, straight from the default camera or browser. They generally do not read 1D barcodes without a dedicated scanning app. So if your plan is “scan it with the phone people already have”, a QR label works out of the box where a linear barcode would need extra software.
QR code vs Data Matrix: choosing a 2D format
Once you have decided on 2D, the next question is usually QR versus Data Matrix. Both are true matrix codes, but they serve different jobs.
- QR Code is the consumer default. Any phone camera reads it, it holds the most data, and it is ideal for URLs and customer-facing labels.
- Data Matrix is the industrial choice for marking tiny parts. It stays readable down to a few millimetres and tolerates significant damage, which is why it dominates electronics, aerospace, and medical-device direct-part marking.
A practical rule: if the label is customer-facing or will be scanned with a phone, use a QR code; if it is a permanent mark on a small or curved item, use Data Matrix. For asset labels you stick on equipment and scan with phones, QR is the natural fit.
How to print 2D codes
Printing a 2D code is less forgiving than printing text, because the reader has to resolve every module. Four things decide whether a printed code scans first time:
- Label size - the more data the code carries, the more modules it has and the larger it must be printed. For phone scanning at arm’s length, a common rule of thumb is a QR code of about 2 x 2 cm or more; Data Matrix can go far smaller when a dedicated imager reads it.
- Contrast - dark modules on a light, matt background. Glossy laminate, coloured label stock, and inverted codes (light on dark) all cost reads.
- Quiet zone - the empty margin around the symbol. The QR specification calls for four modules of clear space on every side, Data Matrix for one. Text or a label edge inside that margin is a common cause of failed scans.
- Printer type - thermal transfer printers give durable labels for equipment and outdoor use; direct thermal suits short-lived labels because the print fades with heat and light; an office laser printer with sticker sheets is fine for indoor labels. Small codes need a higher print resolution to keep the module edges sharp.
Print one label and test-scan it with the device people will actually use before running a batch - changing a setting on the label printer is cheaper than relabelling everything.
GS1 Sunrise 2027: the shift to 2D at checkout
The biggest current development in this topic is GS1 Sunrise 2027. It is an industry initiative for retail point-of-sale systems worldwide to accept 2D codes - QR codes powered by GS1 Digital Link, and GS1 Data Matrix - alongside the legacy EAN and UPC barcodes, by the end of 2027.
The motivation is that a single 2D code can do two jobs at once: ring up the item at checkout and link the shopper to product information, recalls, expiry dates, and sustainability data through the same scan. During the transition, brands dual-mark packaging - printing both a familiar linear barcode and a 2D code - so older tills keep working while newer ones gain the extra capability. The long-term goal is one 2D code that replaces the dual marks entirely.
Two things are worth being clear about. First, this is a migration target, not a hard mandate - timelines vary by retailer and region. Second, it does not mean 1D disappears: billions of linear barcodes are in circulation, and the two formats will coexist for years. So the honest answer to “are QR codes replacing barcodes?” is that 2D is being added at the point of sale, not switched on overnight.
GS1 2D codes and traceability in construction
Retail checkout is not the only place GS1 2D codes are heading. A GS1 2D code - a GS1 Data Matrix, or a QR code carrying a GS1 Digital Link - holds the product’s article number (GTIN) plus details a linear EAN cannot fit: batch number, serial number, production date. That extra data is what makes traceability with 2D codes work: scan the code at each handover and the history shows exactly which batch went where.
The construction industry is a natural fit. Building products such as plasterboard, insulation, and fixings arrive on site in bulk, and the batch matters long after delivery - for warranty claims, product recalls, and documenting what was built into a structure. A 2D code on the pack or pallet label lets the merchant, the site, and later the building owner identify the exact product and batch with one scan, and a Digital Link can lead on to product information such as data sheets and declarations of performance. Adoption varies by manufacturer and market, so check what your suppliers actually print.
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.
With the concrete numbers in mind, the recommendation is evidence-based rather than a matter of taste: choose 1D when you control the readers and only need a short key; choose 2D when you want phone scanning, more data per label, durability, or the GS1 Digital Link capability that checkout is migrating toward.
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. From that record you can check the item in or out, see the current owner, or report an issue.
This is the asset-tag approach in practice: the QR label is the durable, scannable handle, and the asset record behind it holds the detail. 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.
FAQ
What is a 2D code? A 2D code is a machine-readable symbol that stores data both across and down a grid of small squares or dots, rather than in a single row of bars. QR codes and Data Matrix are the best-known examples. Because capacity grows with area, a 2D code can hold a full web address or a structured data string in a symbol a few millimetres to a few centimetres wide.
How do you print 2D codes? You print 2D codes on labels with a thermal transfer or laser printer, in dark print on a light, matt background. Keep each module large enough for the reader - for phone scanning, a QR code of roughly 2 cm or more is a safe starting point - and leave a clear quiet zone around the symbol. Always test-scan a sample label before printing a full batch.
How do you scan a square code? You scan a square code - usually a QR code - by opening your phone’s camera, pointing it at the code, and tapping the link that appears. No app is needed for QR codes. Other square codes, such as the Data Matrix on small parts and packaging, are normally read with a scanning app or a 2D scanner. Good light and a flat, undamaged code help.
What is a 1D barcode? A 1D barcode is a linear code that stores data in the widths of parallel vertical bars and gaps, read in a single pass from side to side. EAN, UPC, Code 128, and Code 39 are common types. It holds only a short number or reference - a lookup key that a system matches to a database record - and needs a scan line that crosses every bar.
What are GS1 2D codes and how are they used in construction? GS1 2D codes are 2D symbols - GS1 Data Matrix and QR codes with GS1 Digital Link - that carry a product’s GS1 article number (GTIN) together with extra data such as batch number, serial number, or production date. In construction they are printed on building products and their packaging, plasterboard for example, so a single scan identifies the exact product and batch and can link to its product information.
What is the difference between 1D and 2D? The difference is that a 1D barcode stores data in one direction, as a row of bars, while a 2D code stores it in two, as a grid. A 1D code therefore holds a short reference and needs a laser or linear scanner; a 2D code holds thousands of characters, scans from any angle with a camera, and still reads when partly damaged.
Where do you come across barcodes? You come across barcodes almost everywhere goods or records need identifying: 1D barcodes on groceries, books, parcels, and library cards; 2D codes on tickets, boarding passes, medicine packs, menus, and payment screens. At work they sit on shipping labels, stock shelves, and asset labels. Wherever typing a number by hand would be slow or error-prone, a barcode usually does the job.
How does traceability with 2D codes work? Traceability with 2D codes works by printing a code on each item or batch that carries its identity - article number plus batch or serial number - and scanning it at every handover. Each scan records what the item is, where it was, and when. Because a 2D code holds batch-level or item-level data, a faulty batch can be traced forward to where it went and back to where it came from.
Is a QR code a 1D or 2D barcode? A QR code is a 2D barcode. It stores data in both directions across a grid of small squares, which is why it can hold a full URL rather than just a short number. The three large squares in its corners are finder patterns that let a camera locate and orient the code, so it scans at any angle - something a linear barcode cannot do.
How can I tell if a barcode is 1D or 2D? Look at the shape. A 1D barcode is a row of parallel vertical lines of different widths, read across a single axis - the classic supermarket stripe. A 2D barcode is a square or rectangular grid of dots or modules read on both axes, usually with locator marks: corner squares on a QR code, or a solid L-shaped border on a Data Matrix. Quick rule of thumb: if you can scan it by pointing your phone at it from any angle, it is almost certainly a 2D code.
How much data can a 1D vs 2D barcode hold? A 1D barcode holds very little: a UPC encodes 12 digits, and Code 128 tops out around 48 characters before the label gets impractically wide. A 2D barcode holds far more in a small square - a QR code can store up to about 7,089 numeric or 4,296 alphanumeric characters, and a Data Matrix up to about 2,335 alphanumeric characters in a much smaller footprint. That is why 1D codes carry a short lookup key while 2D codes can carry a full URL.
Can a smartphone scan a 1D barcode? Phone cameras read 2D codes such as QR natively, straight from the default camera or browser, with no app. They generally do not read 1D barcodes without a dedicated scanning app, because a linear barcode needs different decoding than the area image a phone captures. This is a real advantage for QR in any workflow built around the phone people already carry.
What is GS1 Sunrise 2027 and will 2D barcodes replace 1D barcodes? GS1 Sunrise 2027 is an industry initiative for retail point-of-sale systems worldwide to accept 2D codes - QR powered by GS1 Digital Link, and GS1 Data Matrix - alongside legacy EAN and UPC by the end of 2027. During the transition, brands dual-mark packaging with both a linear barcode and a 2D code. It is a migration target, not a hard mandate, so 1D barcodes will not vanish overnight; the two will coexist for years.
Do 2D barcodes still work when damaged? Usually, yes. Matrix codes such as QR and Data Matrix include built-in error correction, so the code still scans when part of it is scuffed, torn, or covered - a QR code at the highest correction level survives damage to roughly a third of its area. A 1D barcode has no such redundancy across its width: a scratch through the bars typically kills the read.
The takeaway
1D barcodes encode a short key in linear bars and need dedicated scanners; 2D barcodes pack thousands of characters into a small grid, scan from any angle on an ordinary phone, and survive damage. The hard numbers - UPC at 12 digits versus a QR code at ~7,089 - explain why retail is migrating to 2D at the checkout under GS1 Sunrise 2027. For asset tracking the choice is simpler still: QR labels turn every phone into a reader, which is the model AMPthilly is built on.
Tools that make this easier
AMPthilly gives every asset a printable QR label that opens its record in any phone browser - no app to install and no scanner hardware to buy. Scan a label to check the item in or out, see who has it, or report a problem, and every action lands in the asset’s audit history. You can print labels singly or in batches, choose the size for sticker sheets or a label printer, and regenerate a label if one gets damaged. Start free - 3 users and 25 assets, no credit card required - or talk to us about a larger rollout.
Related terms
- Barcode Scanner - the hardware and software that reads both code families
- Label Printer - how barcode and QR labels are produced in volume
- QR Code - the general-purpose 2D code AMPthilly uses for asset labels
- Asset Tag - the durable label that carries an asset’s identifier
- 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