"Barcode" is a family name, not a single format. Each symbology has its own rules about which characters it accepts, how long it can be and where it is used. Choosing the wrong one can mean a scanner that refuses to read your labels or a retailer that rejects your packaging. This overview of the main types of barcodes helps you pick the right one in a few minutes.
Linear (1D) vs 2D barcodes
Linear barcodes store data in a single row of bars and spaces. They are read by laser scanners and imagers, are cheap to print, and typically hold a short number or code. 2D barcodes store data in a grid of squares or stacked rows. They hold much more data, include stronger error correction, and are read by camera-based imagers and smartphones.
Types of barcodes at a glance
| Symbology | Type | Characters | Typical use |
|---|---|---|---|
| EAN-13 | 1D | 13 digits | Retail products worldwide |
| EAN-8 | 1D | 8 digits | Very small retail packages |
| UPC-A | 1D | 12 digits | Retail products, USA & Canada |
| UPC-E | 1D | Compressed UPC | Small US packages |
| Code 128 | 1D | Full ASCII (128 chars) | Shipping labels, inventory, GS1-128 |
| Code 39 | 1D | 0-9, A-Z and a few symbols | Industry, badges, older systems |
| ITF-14 | 1D | 14 digits | Outer shipping cartons |
| Codabar | 1D | Digits and a few symbols | Libraries, older medical systems |
| QR code | 2D | Up to 7,089 digits | Phones: links, WiFi, menus, payments |
| Data Matrix | 2D | Up to about 2,300 characters | Small parts, electronics, healthcare |
| PDF417 | 2D (stacked) | Up to about 1,800 characters | Boarding passes, ID cards |
| Aztec | 2D | Up to about 3,000 characters | Transport tickets |
Retail barcodes: EAN and UPC
EAN-13
The standard product barcode in Europe, Africa, Asia and most of the world. It encodes a 13-digit GTIN whose last digit is a check digit. The number must be licensed from GS1; see how to get a barcode for a product.
EAN-8
A shorter version for packages too small for EAN-13, such as lipsticks or chewing gum. EAN-8 numbers are allocated individually by GS1 and only when an EAN-13 really does not fit.
UPC-A and UPC-E
UPC-A, with 12 digits, is the traditional product code in North America. UPC-E is a compressed six-digit form for small items, available only for certain numbers. Modern retail scanners read both EAN and UPC.

General-purpose barcodes: Code 128 and Code 39
Code 128
Code 128 is the most versatile linear barcode. It encodes all 128 ASCII characters (letters, digits, punctuation) and switches between three internal character sets (A, B and C). Set C packs two digits per symbol, so long numbers stay compact. A GS1 variant called GS1-128 adds "application identifiers" for batch numbers, expiry dates and weights on logistics labels. Code 128 is our default recommendation for inventory, asset tags and shipping labels.
Code 39
Code 39 is older and simpler. The basic set covers 43 characters: digits, uppercase letters and the symbols - . $ / + % and space. Because each character is wide, a Code 39 barcode is longer than a Code 128 for the same data. It is still common in automotive, defense and older industrial systems, and for ID badges.
Code 39 vs Code 128: which one?
- Choose Code 128 for new projects: denser, supports lowercase and all symbols.
- Choose Code 39 only if an existing scanner, software or partner requires it.
Logistics barcodes: ITF-14
ITF-14 (Interleaved 2 of 5) encodes a 14-digit GTIN for outer cartons and cases. It tolerates printing directly on corrugated cardboard and is often surrounded by a thick "bearer bar" frame that protects against partial scans. The 14-digit number is usually derived from the retail GTIN of the item inside, with an indicator digit for the packaging level.
2D barcodes: QR code, Data Matrix, PDF417 and Aztec
- QR code: the 2D code for consumers. Phones read it natively, it holds links, text, WiFi and contacts, and it survives damage thanks to error correction. Make one with the free QR code generator.
- Data Matrix: very compact, ideal for marking tiny parts and medical products. Often used in industry with GS1 data.
- PDF417: a stacked code found on airline boarding passes and many identity documents.
- Aztec: no quiet zone needed; used on many rail and transport tickets.
What is a check digit, and which barcodes have one?
A check digit is an extra digit calculated from the others, so a scanner can detect a misread. EAN-13, EAN-8, UPC-A and ITF-14 always end with a mod-10 check digit computed with alternating weights of 1 and 3. Code 128 includes a mandatory internal checksum that is not shown in the human-readable text. Code 39 has an optional mod-43 check character that some systems require and others ignore. 2D codes such as QR and Data Matrix go further, with Reed-Solomon error correction that can actually rebuild damaged data rather than only detect it.
Printing tips that apply to every type
- Print dark bars or modules on a light background; black on white is safest.
- Respect the quiet zone on both sides of linear barcodes and around 2D codes.
- Do not stretch or squash the image; scale it proportionally.
- Use vector files (SVG) for packaging and labels so edges remain sharp.
- For thermal label printers, set the bar width to a whole number of printer dots to avoid uneven bars.
How to choose the right type of barcode
- Who will scan it? Retail checkout → EAN-13/UPC-A. Warehouse scanner → Code 128 or ITF-14. Customer's phone → QR code.
- What data? Digits only, letters, or a URL? Links and long text need a 2D code.
- How much space? Tiny parts → Data Matrix or EAN-8. Wide labels → Code 128.
- Is there a standard to follow? Retailers, carriers and industries often impose a symbology. Ask before printing.
- Test. Print a sample and scan it with the actual device used in your workflow.
The free barcode generator covers Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14, with PNG and SVG downloads. For many labels at once, combine it with the bulk QR code generator when you also need a QR code per item, and check what your scanners read with the online scanner.
Key takeaways
- EAN-13 and UPC-A are for retail products and need GS1 numbers.
- Code 128 is the best general-purpose linear barcode for labels and stock.
- Code 39 is mainly for compatibility with older systems.
- ITF-14 is for shipping cartons; QR codes are for phones.
For a wider list of symbologies, see Wikipedia's barcode article. To understand the consumer side, read barcode vs QR code.
