Barcode Types Explained: Which Format Should You Use?
Barcodes fall into two families: linear (1D) codes like EAN-13 and Code 128 that store a short number or ID, and 2D codes like QR and Data Matrix that store much more in a small square. The right one depends on who scans it and what it needs to hold.
By PureTools Editorial TeamUpdated 8 min read
1D vs 2D barcodes
A linear or 1D barcode stores data in the widths of parallel bars and spaces. It is read along a single line, which is why classic laser scanners work with it. Linear codes hold a few dozen characters at most and are usually a key that points to a record in a database, such as a product number.
2D barcodes store data in both directions, in a grid of modules or in stacked rows. They hold hundreds or thousands of characters, include strong error correction and can be read from any angle by camera-based scanners, including phones.
Linear (1D) barcode formats
| Format | Data | Where it is used |
|---|---|---|
| EAN-13 | 13 digits | Retail products worldwide |
| UPC-A | 12 digits | Retail products in the US and Canada |
| Code 128 | Full ASCII, variable length | Shipping, logistics, inventory, serial numbers |
| Code 39 | Upper case, digits, 7 symbols | Automotive, defense, ID badges |
| ITF-14 | 14 digits | Outer cartons and shipping cases |
| Codabar | Digits and 6 symbols | Libraries, labs, blood banks, air waybills |
| Pharmacode | Integer 3-131070 | Pharmaceutical packaging line control |
Two-dimensional (2D) barcode formats
| Format | Capacity (approx.) | Where it is used |
|---|---|---|
| QR code | 4,296 alphanumeric characters | Marketing, payments, menus, anything scanned by phones |
| Micro QR | 35 digits | Very small parts and electronics |
| Data Matrix | 2,335 alphanumeric characters | Parts marking, pharma serialisation, electronics |
| PDF417 | 1,850 text characters | Driver licenses, boarding passes, documents |
| Aztec | 3,000 text characters | Rail and airline tickets on phones |
How to choose: a quick decision guide
- Selling a product in shops or on large marketplaces? Use EAN-13 (or UPC-A in North America) with a GS1-issued number.
- Labeling outer cases for distributors? Use ITF-14 or GS1-128 with a GTIN-14.
- Internal inventory, assets, shipping labels or work orders? Use Code 128.
- Consumers will scan it with a phone? Use a QR code.
- Tiny space or direct marking on metal and plastic? Use Data Matrix.
- Tickets on phone screens? Use Aztec. Long records on ID cards? Use PDF417.
- An existing system already defines the format? Match it exactly, including Code 39 or Codabar.
Things that matter for every format
Whatever the symbology, scanning reliability comes down to the same few factors. Keep a clear quiet zone around the code. Print dark bars or modules on a light, matte background. Do not stretch or squash the image; change the size in the generator instead. Export vector SVG or PDF for print, and test a real printed sample with the actual scanner or phones your audience uses.
Finally, remember that the barcode is only a carrier. For retail formats, the number inside must be registered with GS1. For internal formats, make sure your database or software knows what each value means.
Frequently Asked Questions
What is the most common barcode type?
For retail products, EAN-13 and UPC-A, which appear on almost every packaged item sold in shops. For logistics and internal use, Code 128. For anything scanned by phones, the QR code.
Can a phone scan any barcode?
Phone cameras read QR codes natively. Many also read EAN, UPC and Code 128 through scanner apps or built-in features. Data Matrix, PDF417 and Aztec support varies, so test with your audience devices.
Is a QR code a barcode?
Yes. It is a 2D matrix barcode. "Barcode" covers both linear and two-dimensional symbologies.
Which barcode holds the most data?
Among common formats, QR codes and Aztec codes hold the most, a few thousand characters. Linear barcodes hold only a few dozen.
Sources & further reading
About the author — PureTools Editorial Team
Reviewed against GS1 and ISO symbology specs
Barcode and 2D code pages are reviewed against the GS1 General Specifications and the ISO/IEC bar code symbol standards, then re-checked when a specification is revised.
Editorial policy and corrections