Short answer: use UPC-A or EAN-13 for retail products, Code 128 for inventory and shipping labels, ITF-14 or GS1-128 for cartons and pallets, and a QR code for anything people scan with a phone. Data Matrix and PDF417 are for packing a lot of data into a small space, such as medicine packs and ID cards.
What is the difference between 1D and 2D barcodes?
A linear (1D) barcode is the familiar row of black bars and white spaces. The data is in the widths of the bars, read along a single line by a laser or camera scanner. Linear codes are cheap to print and read very quickly, but they hold little data (usually a product or reference number of 8 to about 40 characters) and get wide as the data grows.
A 2D barcode stores data in a grid of square modules or dots, both horizontally and vertically. It holds far more (a QR code can carry a full web address, a contact card or several thousand digits) and includes error correction, so it still reads if part of it is scratched or covered. 2D codes need a camera-based (imaging) scanner or a phone; classic laser scanners can’t read them.
Retail barcodes: UPC and EAN
Products sold in shops carry a GTIN (Global Trade Item Number) issued under a GS1 licence, printed as a UPC or EAN barcode. UPC-A holds 12 digits and is the traditional code in the US and Canada. EAN-13 holds 13 digits and is used everywhere else; a UPC-A is simply an EAN-13 with a leading zero, and checkout systems worldwide read both. UPC-E and EAN-8 are shorter versions for packs too small for the full code. Books use EAN-13 barcodes that start with 978 or 979 (the ISBN). Read UPC vs EAN for the details.
Logistics and inventory barcodes
Code 128 is the workhorse of warehouses and shipping labels. It encodes all 128 ASCII characters, switches to a compact mode for long runs of digits, and every scanner reads it. GS1-128 is Code 128 with GS1 rules: the data is split into fields by Application Identifiers, such as (01) for the GTIN, (17) for the expiry date, (10) for the batch and (00) for the SSCC pallet number.
Code 39 is older and less dense but still required by some automotive, defence and healthcare systems. ITF-14 (Interleaved 2 of 5 with a 14-digit GTIN) tolerates the rough printing on corrugated cartons and is usually framed by a thick bearer bar. Codabar survives in libraries and blood banks.
2D barcodes: QR, Data Matrix, PDF417 and Aztec
QR Code is the 2D code people know, because every phone camera reads it: menus, payments, WiFi and links. Data Matrix is smaller for the same data and is the standard for marking electronic components, medical devices (UDI) and medicine packs as GS1 DataMatrix. PDF417 is a stacked code found on US and Canadian driver’s licences and many shipping documents. Aztec needs no quiet zone and is widely used on rail and airline mobile tickets.
Barcode types compared
| Type | Kind | Data | Typical use |
|---|---|---|---|
| UPC-A | 1D | 12 digits (GTIN-12) | Retail products, US and Canada |
| UPC-E | 1D | 8 digits (compressed UPC-A) | Small packs in North America |
| EAN-13 | 1D | 13 digits (GTIN-13) | Retail products worldwide, books (ISBN) |
| EAN-8 | 1D | 8 digits (GTIN-8) | Very small retail packs |
| Code 128 | 1D | All 128 ASCII characters | Shipping, inventory, warehouse labels |
| GS1-128 | 1D | GS1 data with Application Identifiers | Pallets, cases, batch and expiry dates |
| Code 39 | 1D | A–Z, 0–9, space and - . $ / + % | Automotive, defence, ID badges |
| ITF-14 | 1D | 14 digits (GTIN-14) | Outer cartons and corrugated boxes |
| Interleaved 2 of 5 | 1D | Digits, even count | Warehousing, cartons |
| Codabar | 1D | Digits and - $ : / . + | Libraries, blood banks, older systems |
| GS1 DataBar | 1D / stacked | GTIN, plus extra data in Expanded | Fresh food, coupons, small items |
| Intelligent Mail | 4-state | 20–31 digits | US mail sorting (USPS) |
| QR Code | 2D | Up to 7,089 digits or ~2,900 characters | Links, WiFi, payments, marketing |
| Data Matrix | 2D | Up to 3,116 digits or 2,335 characters | Parts marking, healthcare (UDI), pharma |
| GS1 DataMatrix | 2D | GS1 data: GTIN, batch, expiry, serial | Medicines, medical devices |
| PDF417 | Stacked 2D | Up to ~1,850 characters | Driver’s licences, ID cards, shipping |
| Aztec Code | 2D | Up to ~3,000 characters | Train and airline tickets |
| MaxiCode | 2D | Up to 93 characters | UPS parcel sorting |
| Micro QR | 2D | Up to 35 digits | Tiny parts and labels |
BarcodeJar supports over 100 symbologies, including postal, pharmaceutical and composite codes. Browse them all on the barcode types page.
Which barcode should I use?
Start from where the code will be scanned and who controls the scanner. Retail checkouts expect GS1 codes; your own warehouse can use anything your scanners read; customers with phones need a QR code.
| If you need to… | Use | Notes |
|---|---|---|
| Selling a product in shops or online marketplaces | UPC-A (US/Canada) or EAN-13 | Needs a GS1-licensed GTIN |
| Publishing a book | ISBN barcode (EAN-13 starting 978/979) | Needs an ISBN from your national agency |
| Labelling stock, bins or SKUs inside your business | Code 128 | Any letters and numbers you choose |
| Marking shipping cartons of a retail product | ITF-14 or GS1-128 | GTIN-14 for the case |
| Pallet labels with batch, expiry or SSCC | GS1-128 | Use the SSCC generator for pallet IDs |
| Amazon FBA units | FNSKU label (Code 128) | Amazon assigns the FNSKU |
| Asset tags, ID badges, library cards | Code 128 or Code 39 | Code 39 if old scanners require it |
| Small parts or lots of data in a tiny space | Data Matrix | Needs a 2D imaging scanner |
| Medicines and medical devices | GS1 DataMatrix | Follow your regulator’s UDI or serialisation rules |
| Something customers scan with a phone | QR code | Static QR codes never expire |
| ID cards or documents with lots of text | PDF417 | Common on driver’s licences |
How do I check a barcode will scan?
Before printing a run, check three things. First, the number: retail codes end in a check digit, which you can confirm with the check digit calculator or barcode validator. Second, the size and quiet zone: see the barcode size guide. Third, the print itself: scan a proof with a phone using our barcode scanner, ideally also with the scanner that will be used in practice.
Frequently asked questions
What are the main types of barcodes?
Barcodes are either linear (1D) or two-dimensional (2D). The most common linear types are UPC and EAN for retail products, Code 128 and Code 39 for logistics and inventory, ITF-14 for shipping cartons and GS1-128 for supply-chain data. The most common 2D types are QR Code, Data Matrix, PDF417 and Aztec.
What type of barcode is used on products in stores?
UPC-A in the US and Canada and EAN-13 almost everywhere else. Both encode a GS1 product number (GTIN), and modern checkout scanners read both. Small packs may use the shorter UPC-E or EAN-8.
Which barcode is best for inventory?
Code 128 is the usual choice for internal inventory, SKU and bin labels: it encodes letters and numbers, is compact and every scanner reads it. If you need more data in a small space, or want phones to scan it, use Data Matrix or a QR code.
Can my phone scan every type of barcode?
Phone cameras read QR codes natively. Most other common types (UPC, EAN, Code 128, Code 39, Data Matrix, PDF417, Aztec) can be read with a scanner app or our online barcode scanner. Laser scanners read only linear barcodes; reading 2D codes needs an imaging (camera-based) scanner.
Do I need permission to use a barcode type?
No. The symbologies themselves are open standards that anyone can print. What you may need is a valid number: retail UPC/EAN codes must carry a GTIN licensed from GS1. Internal codes such as Code 128 asset tags can hold any data you like.
What is the difference between a 1D and a 2D barcode?
A 1D barcode stores data in the widths of parallel bars and is read across one line, holding roughly 20–50 characters. A 2D barcode stores data in a grid of squares or dots, holds hundreds to thousands of characters, and keeps working when part of it is damaged thanks to error correction.