Complete Guide

Barcode types explained.

There are dozens of barcode formats in use worldwide. Most businesses only need one. This guide helps you figure out which.

Linear Barcodes

1D barcodes

Linear barcodes store data in a single row of vertical bars and spaces. They have been the standard for retail and logistics since the 1970s. If you are working with physical products, shipping, or inventory, one of these formats is probably what you need.

Code 128

The universal workhorse

If you are not sure which barcode to use, start here. Code 128 handles any combination of letters, numbers, and symbols with no fixed length. It produces compact, high-density barcodes that work with virtually every scanner on the market.

When to use it

You need a barcode for internal operations - inventory labels, asset tags, work orders, shipping labels, or anything that does not require a standardized retail product number.

WarehousingLogisticsManufacturingHealthcareAsset Tracking

Data

Letters, numbers, symbols

Length

Variable (no limit)

Check

Automatic (Mod 103)

UPC-A

The retail standard in North America

Walk into any store in the United States or Canada and pick up a product. The barcode on it is almost certainly UPC-A. This 12-digit format has been the backbone of retail since 1974 when the first UPC was scanned on a pack of Wrigley's chewing gum in Ohio.

When to use it

You are selling a physical product through retail stores in the US or Canada. Retailers require UPC-A barcodes for point-of-sale scanning. You will need a GS1 company prefix to get a unique number.

Retail (US/Canada)GroceryConsumer GoodsE-commerce (Amazon, Walmart)

Data

Numbers only

Length

Exactly 12 digits

Check

Built-in (last digit)

EAN-13

The global version of UPC

EAN-13 is the international equivalent of UPC-A. It uses 13 digits instead of 12, with the extra digit representing the country of origin. Every UPC-A barcode is technically an EAN-13 with a leading zero. If you are selling products outside North America, this is your format.

When to use it

You are selling products in Europe, Asia, South America, Africa, or Australia. International retailers and marketplaces require EAN-13. Like UPC-A, you need a GS1 prefix.

International RetailExportGlobal E-commercePublishing (books use ISBN, which is EAN-13)

Data

Numbers only

Length

Exactly 13 digits

Check

Built-in (last digit)

EAN-8

For products too small for a full barcode

Some products are physically too small to fit a standard EAN-13 or UPC-A barcode. Lip balm tubes, candy bars, small cosmetics - when the packaging is tiny, EAN-8 gives you a scannable barcode in half the space. It uses 8 digits and produces a noticeably shorter barcode.

When to use it

Your product packaging is too small for a full-size barcode. EAN-8 numbers are assigned directly by your local GS1 office (you cannot derive them from your company prefix).

CosmeticsConfectionerySmall Consumer GoodsPharmaceuticals

Data

Numbers only

Length

Exactly 8 digits

Check

Built-in (last digit)

Code 39

The government and military standard

Code 39 is one of the oldest barcode formats still in wide use. It is the required format for the US Department of Defense (MIL-STD-1189) and is used across government agencies, military logistics, and automotive manufacturing. Its main advantage: it is self-checking, meaning it does not require a check digit.

When to use it

You work with government contracts, military supply chains, or the automotive industry. Code 39 is also common in libraries and older inventory systems.

GovernmentMilitary (DoD)Automotive (AIAG)Libraries

Data

Letters (A-Z), numbers, some symbols

Length

Variable

Check

Optional (self-checking)

ITF-14

Built for shipping cartons

ITF-14 is specifically designed for marking outer shipping cartons and cases, not individual products. The "ITF" stands for Interleaved Two of Five - it encodes digits in pairs, which makes it efficient but limits it to numbers only. The thick bars print well on corrugated cardboard, which is why logistics companies prefer it.

When to use it

You are labeling shipping cases, pallets, or outer cartons that contain multiple products inside. The ITF-14 identifies the case, while the products inside have their own UPC-A or EAN-13 barcodes.

ShippingDistributionWholesaleWarehousing

Data

Numbers only

Length

Exactly 14 digits

Check

Built-in (last digit)

Matrix Barcodes

2D barcodes

Two-dimensional barcodes store data in a grid instead of a single line. They hold far more information and can be scanned by smartphone cameras. QR codes are the most well-known, but Data Matrix and PDF417 serve critical roles in healthcare, manufacturing, and government.

Data Matrix

Tiny items, massive data

Data Matrix is a 2D barcode that can be printed as small as 2mm x 2mm while remaining scannable. The electronics industry uses it to mark individual components like resistors and chips. Healthcare uses it on surgical instruments, medication vials, and lab samples. It is also the format required by the US FDA for unique device identification (UDI) on medical devices.

When to use it

You need to mark very small items, or you work in an industry that requires Data Matrix specifically (electronics manufacturing, medical devices, pharmaceutical serialization).

ElectronicsMedical DevicesPharmaceuticalsAerospace

Data

Any (text, numbers, binary)

Capacity

Up to 2,335 characters

Error correction

Reed-Solomon error correction

PDF417

The identity document format

PDF417 is a stacked barcode that stores data across multiple rows. It can hold up to 1,850 characters - enough for a paragraph of text or a set of biometric data. Look at the back of your driver's license: that is a PDF417 barcode. Airlines use it on boarding passes. Government agencies use it on official documents.

When to use it

You need to encode large amounts of data in a scannable format, typically for identity documents, tickets, or passes. PDF417 has built-in error correction, so it scans even when partially damaged.

Government IDsAirlinesEvent TicketingTransportation

Data

Any (text, numbers, binary)

Capacity

Up to 1,850 characters

Error correction

Reed-Solomon error correction

Looking for QR codes?

Create QR codes for URLs, WiFi, contact cards, email, and SMS with our free QR code generator.

Generate QR Codes

Side-by-side comparison

All barcode formats at a glance. Compare data capacity, use cases, and requirements.

FormatTypeDataLengthBest for
Code 1281DLetters, numbers, symbolsVariable (no limit)Warehousing, Logistics
UPC-A1DNumbers onlyExactly 12 digitsRetail (US/Canada), Grocery
EAN-131DNumbers onlyExactly 13 digitsInternational Retail, Export
EAN-81DNumbers onlyExactly 8 digitsCosmetics, Confectionery
Code 391DLetters (A-Z), numbers, some symbolsVariableGovernment, Military (DoD)
ITF-141DNumbers onlyExactly 14 digitsShipping, Distribution
Data Matrix2DAny (text, numbers, binary)Up to 2,335 charactersElectronics, Medical Devices
PDF4172DAny (text, numbers, binary)Up to 1,850 charactersGovernment IDs, Airlines

FAQ

Common questions about barcode types and formats.

There are over 30 barcode symbologies in use worldwide, but most businesses only need one of about 8 common formats. Linear (1D) barcodes like UPC-A, EAN-13, Code 128, and Code 39 handle the majority of retail and logistics. Matrix (2D) barcodes like QR codes, Data Matrix, and PDF417 are used when you need to store more data or scan with a phone camera.
For retail products, UPC-A is the most common in North America and EAN-13 is the most common internationally. For general-purpose labeling (inventory, shipping, asset tracking), Code 128 is the most widely used because it supports letters, numbers, and symbols with no length restrictions.
1D (linear) barcodes store data in a single row of vertical bars. They hold small amounts of data (typically a product number) and are read by laser scanners. 2D barcodes like QR codes store data in a grid pattern, hold thousands of characters, and can be scanned by smartphone cameras.
For retail products sold in US/Canada stores, use UPC-A. For products sold internationally, use EAN-13. For shipping cartons, use ITF-14. For internal inventory or asset labels, use Code 128. For items that consumers will scan with their phones, use a QR code.
Yes. GenerateBarcode.io lets you create any barcode format for free, directly in your browser. The barcode image is free. If you need a unique product number (UPC or EAN) for retail, you will need to purchase one from GS1.

Ready to generate your barcode?

Pick your format, enter your data, download as PNG or SVG. Free, instant, no account needed.