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
| Barcode | Family | Approximate capacity |
|---|---|---|
| UPC-A | 1D | 12 digits |
| EAN-13 | 1D | 13 digits |
| Code 128 | 1D | Dozens of characters in practice, full ASCII |
| QR code | 2D | Up to about 7,000 digits or 4,000 characters |
| Data Matrix | 2D | Up to about 3,100 digits or 2,300 characters |
| PDF417 | 2D | Up 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
| Need | Better choice |
|---|---|
| Retail checkout | 1D: UPC or EAN, required by retailers |
| Shipping cartons | 1D: ITF-14 or GS1-128 |
| Warehouse inventory | 1D: Code 128 |
| Link to a web page, payment, ticket | 2D: QR code |
| Tiny parts, direct marking | 2D: Data Matrix |
| IDs and boarding passes | 2D: PDF417 |
| Healthcare labeling with batch and expiry | Either GS1-128 or GS1 Data Matrix |
Which to pick
- Does a retailer or marketplace require a specific format? If so, use it. Retail systems expect UPC or EAN.
- How much data? A short ID fits 1D. Anything longer than a few dozen characters, or structured data, points to 2D.
- Who scans it? If customers use phones, QR is easiest. If a legacy laser scanner is involved, stay with 1D.
- 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
- 1D is simple, cheap to scan and required by retail.
- 2D holds far more data, in less space, with error correction.
- Match the code to your scanners and your buyers first.
To read either kind from a photo, use the barcode scanner. For tiny labels, compare Data Matrix and the Micro QR code.