Types of Barcodes Explained: 9 Formats and When to Use Each

From the UPC on a cereal box to the QR code on a restaurant table, different barcodes solve different problems. This guide breaks down the nine formats you will actually encounter.

The most common barcode types are UPC-A and EAN-13 for retail products, Code 128 and Code 39 for labels and inventory, ITF-14 for shipping cartons, and QR Code and Data Matrix for two-dimensional data like URLs and serial numbers. Retail formats require a GS1-issued GTIN; the others work with any data you choose.

One-dimensional vs two-dimensional barcodes

Every barcode falls into one of two families. One-dimensional (1D) barcodes store data in the widths and spacing of vertical bars, and they are read by sweeping a laser or camera across one line. Two-dimensional (2D) barcodes store data in both directions across a grid, and they are read by taking a picture. The 1D family includes UPC, EAN, Code 128, and Code 39. The 2D family includes QR Code and Data Matrix.

The practical difference is capacity and direction. A 1D barcode holds a short string, usually 10 to 48 characters, and must be scanned in roughly the right orientation. A 2D barcode can hold thousands of characters, scans from any angle, and keeps working even when part of the symbol is damaged, thanks to built-in error correction.

The 9 barcode types worth knowing

FormatWhat it encodesTypical use
UPC-A12 digits (GTIN-12)Retail products in the US and Canada
EAN-1313 digits (GTIN-13)Retail products worldwide
Code 128All 128 ASCII charactersShipping, logistics, asset labels
Code 3943 characters (uppercase, digits, some symbols)Military, automotive, harsh environments
ITF-1414 digits (GTIN-14)Shipping cartons and cases
Code 93Full ASCII, compactCanadian postal, some logistics
CodabarDigits plus a few symbolsBlood banks, libraries, parcel tracking
QR CodeUp to 4,296 alphanumeric charactersURLs, payments, tickets, marketing
Data MatrixUp to 2,335 alphanumeric charactersSmall parts, electronics, medical devices

UPC-A and EAN-13: the retail pair

UPC-A is the twelve-digit barcode on products sold in the United States and Canada. EAN-13 is the thirteen-digit barcode used on products sold everywhere else, and most modern scanners read both. The two formats are closely related: a UPC-A number is just a GTIN-12, and many systems convert between the two by adding a leading zero to make a GTIN-13.

The digits have structure. A UPC-A symbol holds a one-digit number system character, a five-digit manufacturer code, a five-digit product code, and a one-digit check digit. An EAN-13 holds a two to three digit GS1 country prefix, a company number, a product number, and a check digit. You cannot invent these numbers. Both formats require a GTIN issued through GS1, and retailers reject made-up numbers. See our guide to getting a UPC barcode for your product for the full process.

Code 128 and Code 39: the label workhorses

Code 128 is the default choice for labels you print yourself: inventory tags, asset labels, shipping cartons, and warehouse bins. It encodes all 128 ASCII characters, so it handles lowercase letters and punctuation, and it packs data tightly. Almost every scanner built in the last twenty years reads it.

Code 39 is older and simpler. It supports only 43 characters, but its wide bars tolerate cheap printers, photocopies, and rough surfaces. The US military and the auto industry still require it for nameplates in harsh environments. For a detailed head-to-head, read Code 128 vs Code 39.

ITF-14, Code 93, and Codabar: the specialists

ITF-14 (Interleaved 2 of 5) prints the 14-digit GTIN of a shipping carton, usually inside a thick bearer bar rectangle that keeps the edges from curling on corrugated cardboard. Code 93 is a compact full-ASCII format used by Canada Post and some logistics systems. Codabar encodes digits with a small set of symbols and shows up in blood banks, libraries, and photo labs, where its simple structure is an advantage.

QR Code and Data Matrix: the 2D pair

QR codes store far more data than any 1D barcode: up to 7,089 numeric digits or 4,296 alphanumeric characters, plus Reed-Solomon error correction that recovers the data even if up to 30 percent of the symbol is damaged. That is why they carry URLs, Wi-Fi credentials, payment addresses, and boarding passes. Data Matrix packs similar capability into a smaller square, which is why electronics manufacturers print it directly onto circuit boards and medical devices mark it on tiny instruments. For the full comparison, see QR code vs barcode.

How to choose the right type

  • Selling a product in stores: UPC-A for the US and Canada, EAN-13 for international retail. Get the number from GS1 first.
  • Printing your own labels: Code 128 is the best default. Use Code 39 only if your system or customer requires it.
  • Marking shipping cartons: ITF-14 with the carton GTIN-14.
  • Linking to a website or app: QR Code.
  • Marking very small items: Data Matrix.

Once you know the format, generate the barcode free right in your browser: this site draws Code 128, Code 39, EAN-13, and UPC-A on a canvas with correct check digits and exports a print-ready PNG.

Frequently asked questions

Should I use EAN or UPC?

Use UPC-A for products sold in the United States and Canada, and EAN-13 for products sold anywhere else. Most modern scanners read both, and a UPC-A converts to a GTIN-13 by adding a leading zero. The deciding factor is where the product is sold, not personal preference.

What is a GTIN vs UPC?

GTIN (Global Trade Item Number) is the number; UPC-A is the barcode symbol that carries it. A UPC-A symbol encodes a GTIN-12, which is a twelve-digit GTIN. EAN-13 symbols encode GTIN-13 numbers. Think of the GTIN as the identity and the barcode as the printed representation.

What is a GS1 barcode?

A GS1 barcode is any barcode carrying a number issued by GS1, the global numbering authority. UPC-A, EAN-13, and ITF-14 are GS1 formats. GS1 licenses the company prefixes that make each number globally unique, which is why retailers trust them.

How many different barcodes are possible?

Dozens of symbologies exist, but nine cover nearly all real-world use: UPC-A, EAN-13, Code 128, Code 39, ITF-14, Code 93, Codabar, QR Code, and Data Matrix. Everything else is a niche or legacy format.

Ready to make your barcode? Generate a print-ready PNG in seconds, free, with correct check digits.

Try the free barcode generator