1D vs 2D Barcodes: Which One Do You Need?
When creating a barcode, the first question that usually comes up is: should I use a line barcode or a QR Code? Both are called barcodes, but they store data differently, so their uses differ too.
1D (linear) barcodes
A 1D barcode is a barcode made of vertical lines. Data is stored in one direction, from left to right. The best-known examples are EAN-13 on product packaging and Code 128 on shipping labels.
- Small capacity, usually a dozen to a few dozen characters.
- Can be read by inexpensive, very fast checkout laser scanners.
- Suitable for product codes, serial numbers, and tracking numbers.
2D barcodes
A 2D barcode stores data in two directions, horizontally and vertically, so it can hold much more. Examples include QR Code, Data Matrix, PDF417, and Aztec.
- Large capacity, from dozens to thousands of characters.
- Can be scanned by a phone camera from various directions.
- Has error correction, so it remains readable even when partly damaged.
- Can be made very small, for example Data Matrix on electronic components.
Quick comparison
| 1D Barcode | 2D Barcode | |
|---|---|---|
| Shape | Vertical lines | Squares/dots within a square |
| Capacity | Small | Large |
| Scanning device | Laser scanner or camera | Camera or 2D scanner |
| Damage resistance | Limited | Has error correction |
| Examples | EAN-13, UPC-A, Code 128 | QR Code, Data Matrix, PDF417 |
When to use which?
- Products sold in stores or convenience stores: use an official EAN-13 from GS1. See how to get an EAN-13 barcode.
- Warehouse, shelf, or shipping labels: Code 128 is a common choice because it is compact and supports both letters and numbers.
- Links, menus, WiFi, or contacts for customers: QR Code, because it can be scanned directly with a phone camera.
- Very small labels: Data Matrix.
- ID cards, boarding passes, or documents: PDF417 or Aztec.
You can create all of the types above for free at I Need Barcode. If you are still unsure, start with a QR Code for customer-facing needs and Code 128 for internal needs.
Frequently Asked Questions
Can a checkout scanner read QR Codes?
Not all of them. 1D laser scanners only read line barcodes. QR Codes require a camera-based 2D scanner or a phone camera.
Which barcode is the smallest?
Data Matrix is a 2D barcode that can be printed very small, so it is often used on electronic components, medical devices, and medicine labels.
Can I use a QR Code instead of EAN-13 on retail products?
To be sold in retail stores, products still need a registered EAN-13 or UPC. A QR Code can be added to the packaging as a complement, for example for product information or promotions.


