Types of Barcodes: 1D and 2D Formats and Their Uses
Barcodes fall into two families. 1D (linear) barcodes are the familiar vertical bars that hold a short string of digits or characters. 2D barcodes, like QR codes, use a grid of squares and hold much more data. The right type depends on what you are labeling and who needs to scan it.
1D barcodes
A 1D barcode is read in a single line across the bars. Most hold under about 50 characters, and many are a pure number. Their strength is simplicity: any scanner reads them quickly, even cheap laser models.
UPC-A has 12 digits and is the retail standard in the United States and Canada. EAN-13 has 13 digits and is the retail standard everywhere else; ISBN book barcodes are EAN-13s. Code 128 is a compact, high-density symbology that can encode the full ASCII character set, which makes it the default for shipping labels and warehouse inventory. Code 39 is an older format using uppercase letters, digits and a few symbols, still common in industrial and government settings, ID badges and automotive parts. ITF-14 is a 14-digit code printed on cartons and cases, usually inside a thick border. GS1-128 is Code 128 with a structured layout for data like batch numbers, expiry dates and pallet IDs, used in logistics and healthcare.
2D barcodes
2D barcodes encode data in both directions, so they hold far more in less space and can include error correction that survives scratches and smudges. They need a camera-based scanner, which every smartphone has.
QR code is the best known, used for links, payments, Wi-Fi sharing and tickets. Data Matrix is a compact square code used on small parts, electronics and pharmaceuticals, where it can be marked directly on metal or plastic. PDF417 is a stacked-row code found on driver licenses and boarding passes, holding well over a kilobyte of data.
Where each type is used
| Barcode | Family | Typical use | Data it holds |
|---|---|---|---|
| UPC-A | 1D | Retail products in North America | 12 digits |
| EAN-13 | 1D | Retail products worldwide, books | 13 digits |
| Code 128 | 1D | Shipping, inventory, asset tags | Full ASCII |
| Code 39 | 1D | Badges, industrial, government | Uppercase, digits, a few symbols |
| ITF-14 | 1D | Cartons and cases | 14 digits |
| GS1-128 | 1D | Logistics with batch and date data | Structured fields |
| QR code | 2D | Links, payments, marketing | Thousands of characters |
| Data Matrix | 2D | Small parts, medical devices | Up to about 2,300 characters |
| PDF417 | 2D | IDs, boarding passes | Over 1 KB |
How to choose
- Selling in stores: UPC-A for North America, EAN-13 for international. Retailers expect these.
- Shipping cartons: ITF-14 or GS1-128, depending on whether the buyer needs only the item number or extra data.
- Internal inventory or asset tracking: Code 128 is the easiest to start with, and you can encode your own SKUs.
- Sending people to a web page: a QR code.
- Very small items or direct part marking: Data Matrix.
- Government or older industrial systems: Code 39 if the other side already uses it.
When in doubt, ask the party who will scan the code which formats their system accepts. A beautiful barcode no one's scanner is set up to read is useless.
Generate any of them
Barcode Ready has a free generator for each of the common formats: UPC, EAN-13, Code 128, Code 39, ITF-14, GS1-128, QR code, Data Matrix and PDF417. The main barcode generator lets you switch between them. Everything is drawn in your browser and nothing is uploaded.
Printing tips that apply to all types
- Keep a clear blank margin (the quiet zone) on both sides of 1D codes.
- Print black on white or another high-contrast pair. Avoid red bars, which many scanners cannot see.
- Do not stretch a barcode non-proportionally.
- Test with the scanner you will actually use.