Types of barcodes: which one should you use?

By · · Updated · 5 min read
Types of barcodes: EAN-13, Code 128, Code 39, ITF-14 and QR code
In short: The main types of barcodes are retail codes (EAN-13, EAN-8, UPC-A, UPC-E), general-purpose linear codes (Code 128, Code 39), the ITF-14 code for shipping cartons, and 2D codes (QR code, Data Matrix, PDF417, Aztec). Use EAN/UPC for products in stores, Code 128 for inventory and labels, and QR codes for phones.

"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

SymbologyTypeCharactersTypical use
EAN-131D13 digitsRetail products worldwide
EAN-81D8 digitsVery small retail packages
UPC-A1D12 digitsRetail products, USA & Canada
UPC-E1DCompressed UPCSmall US packages
Code 1281DFull ASCII (128 chars)Shipping labels, inventory, GS1-128
Code 391D0-9, A-Z and a few symbolsIndustry, badges, older systems
ITF-141D14 digitsOuter shipping cartons
Codabar1DDigits and a few symbolsLibraries, older medical systems
QR code2DUp to 7,089 digitsPhones: links, WiFi, menus, payments
Data Matrix2DUp to about 2,300 charactersSmall parts, electronics, healthcare
PDF4172D (stacked)Up to about 1,800 charactersBoarding passes, ID cards
Aztec2DUp to about 3,000 charactersTransport 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.

Types of barcodes generated on QRCode.boats: EAN-13, UPC-A, Code 128, Code 39, ITF-14
The free generator supports the six most common linear barcode types.

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

  1. Who will scan it? Retail checkout → EAN-13/UPC-A. Warehouse scanner → Code 128 or ITF-14. Customer's phone → QR code.
  2. What data? Digits only, letters, or a URL? Links and long text need a 2D code.
  3. How much space? Tiny parts → Data Matrix or EAN-8. Wide labels → Code 128.
  4. Is there a standard to follow? Retailers, carriers and industries often impose a symbology. Ask before printing.
  5. 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.

Create Code 128, EAN-13, UPC-A, Code 39 or ITF-14 barcodes for free.

Online barcode generatorFree QR code maker

Frequently asked questions

What is the most common type of barcode?

For consumer products, EAN-13 is the most widespread worldwide, with UPC-A dominant in the USA and Canada. For logistics and internal labels, Code 128 is the most common linear barcode. Among 2D codes, the QR code is the most familiar to the public because every smartphone can read it.

Which barcode type is best for inventory?

Code 128 is usually the best choice: it encodes letters, digits and symbols, stays compact for long numbers and is read by virtually every scanner. Use Code 39 only if your existing software requires it. For very small items, a Data Matrix or a small QR code can be a better fit.

Can I use Code 128 on products sold in shops?

Not as the main product barcode. Retail checkouts expect an EAN-13 or UPC-A with a registered GTIN. Code 128 is fine for internal stock codes, shelf labels or shipping, and GS1-128 is the GS1 version used on logistics labels with batch and date data.

Can a smartphone read all types of barcodes?

Phones read QR codes natively and many can read EAN, UPC and Code 128 through the camera, Google Lens or a scanner app. Support for Data Matrix, PDF417 or Aztec depends on the app. For business workflows, test with the exact device your staff will use.

QRCode.boats Editorial Team — QR code & barcode tool makers. Written by the team that builds and maintains the free QR code and barcode generators on QRCode.boats.

Related guides