Barcode Ready
← Barcode Guides

1D vs 2D Barcodes: Capacity, Scanners and Use Cases

1D barcodes are the traditional lines of bars that store a short number or text. 2D barcodes, such as QR codes and Data Matrix, store data in a grid of squares and can hold hundreds or thousands of characters. Use 1D when you only need to identify an item with a short code and 2D when you need more data, small size or phone scanning.

How they differ

A 1D barcode encodes data in one direction: the widths of bars and spaces from left to right. The height is only there so a scanner can cross it at different angles. A 2D barcode encodes in both directions, using a matrix of dark and light modules or stacked rows of bars. That gives it a far higher data density per square inch.

Capacity

BarcodeFamilyApproximate capacity
UPC-A1D12 digits
EAN-131D13 digits
Code 1281DDozens of characters in practice, full ASCII
QR code2DUp to about 7,000 digits or 4,000 characters
Data Matrix2DUp to about 3,100 digits or 2,300 characters
PDF4172DUp to about 1,800 characters

Capacity values depend on the error-correction level and are maximums; practical codes hold much less so they remain easy to scan.

Scanners

1D barcodes can be read by cheap laser scanners and by camera-based ones. 2D codes require an imager, meaning a camera with decoding software, such as a phone or a modern handheld scanner. Many retail checkouts now use imagers, so both types read well there, but older laser-only scanners in warehouses or shops cannot read 2D codes. Check what your scanning equipment supports before you switch.

Error correction

2D codes include error correction. A QR code can be partly dirty, torn or covered and still scan, depending on the level you choose. A 1D barcode has only a single check digit, which detects a bad read but cannot fix it. Damaged 1D barcodes simply fail.

Size

2D codes can be much smaller for the same data. A Data Matrix a few millimeters wide can hold a serial number, which is why it is used on small electronics and medical parts. A 1D barcode needs a certain width for the bars to be readable, so long values make it wider.

Use cases

NeedBetter choice
Retail checkout1D: UPC or EAN, required by retailers
Shipping cartons1D: ITF-14 or GS1-128
Warehouse inventory1D: Code 128
Link to a web page, payment, ticket2D: QR code
Tiny parts, direct marking2D: Data Matrix
IDs and boarding passes2D: PDF417
Healthcare labeling with batch and expiryEither GS1-128 or GS1 Data Matrix

Which to pick

  1. Does a retailer or marketplace require a specific format? If so, use it. Retail systems expect UPC or EAN.
  2. How much data? A short ID fits 1D. Anything longer than a few dozen characters, or structured data, points to 2D.
  3. Who scans it? If customers use phones, QR is easiest. If a legacy laser scanner is involved, stay with 1D.
  4. How much space? Very small labels favor Data Matrix.

Many products use both. The package carries a UPC for the cashier and a QR code that links to instructions or a website.

Try them

Barcode Ready draws all of these in your browser, with nothing uploaded. The main barcode generator switches between formats, and there are dedicated pages for the QR code generator, Data Matrix generator, Code 128 and UPC. Download SVG for print and PNG for screens, then test with the scanner you will use.

Summary

To read either kind from a photo, use the barcode scanner. For tiny labels, compare Data Matrix and the Micro QR code.

Try it