Guide

Types of barcodes, with example images

By · Updated · 7 min read

There are more than a hundred barcode formats on record, but about fourteen cover nearly everything you will meet on a product, parcel, ticket or ID card. They fall into two families. Linear (1D) barcodes are a row of bars read in one sweep, and they usually hold a number of 8 to 20 characters. 2D barcodes are a grid read as an image, and they hold up to a few thousand characters.

Every image below is a real barcode, generated by the same code as the barcode generator. Point a phone at one and it will scan.

Not sure which type you have? Scan it and the result names the format.

Open the online barcode scanner

Linear (1D) barcodes

UPC-A

UPC-A

Twelve digits. The retail barcode of the United States and Canada, on almost every product in a supermarket there. It holds a company prefix, an item number and a check digit, and nothing about price. See what UPC numbers mean, or read one with the UPC scanner.

UPC-E

UPC-E

A squeezed UPC for small packs such as soda cans and cosmetics. It prints 8 digits but stands for a full 12-digit UPC-A with zeros removed.

EAN-13

EAN-13

Thirteen digits. The retail barcode everywhere outside North America, and the format of the ISBN barcode on books. A UPC-A is an EAN-13 with a leading zero. The first three digits are a GS1 country prefix. Compare the two in EAN vs UPC.

EAN-8

EAN-8

Eight digits, for packs too small for an EAN-13, such as lip balm and chewing gum.

Code 128

Code 128

Letters, digits and punctuation, at any length, in a compact width. The workhorse of shipping labels, tracking numbers and warehouse tags. When it follows GS1 rules for dates, lots and pallet numbers it is called GS1-128. The Code 128 reader decodes both.

Code 39

Code 39

Capital letters, digits and seven symbols. Dating from 1974, it is wider than Code 128 for the same data but simple enough to print with a barcode font. Still common on name badges, asset tags and in defence and automotive supply chains.

Code 93

Code 93

A denser successor to Code 39 with two check characters. Used by Canada Post and on some electronic components.

ITF-14

ITF-14

Fourteen digits inside a thick black frame. Printed on outer cartons, because its wide bars survive rough printing on corrugated cardboard. The number is a GTIN-14, which identifies the case and not the single item inside. See what is a GTIN.

Codabar

Codabar

Digits and a few symbols, wrapped in start and stop letters A to D. An older format that lives on in libraries, blood banks and photo labs.

GS1 DataBar

GS1 DataBar

A small barcode that carries a full 14-digit GTIN. Found on the stickers on loose fruit and vegetables and on coupons. The expanded version can add a weight or an expiry date.

2D barcodes

QR Code

Three large squares in the corners make it easy to recognize. Invented in Japan in 1994 for tracking car parts, it now carries links, payments, Wi-Fi logins and tickets. It holds up to 4,296 letters and digits and still reads with up to 30% of the symbol damaged. Read one with the QR code scanner.

Data Matrix

A solid L on two sides and a dotted edge on the other two. It packs data into a smaller space than QR and reads when only 2 to 3 mm across, so it is used on medicine packs, medical devices and electronic parts. Read one with the Data Matrix scanner.

PDF417

A wide rectangle of stacked rows. It holds about 1,800 characters and is the barcode on the back of US and Canadian driver’s licenses and on printed boarding passes. The PDF417 scanner turns its contents into labeled fields.

Aztec

A bullseye in the centre and no need for a blank border, which lets it sit in tight spaces. Common on rail tickets and on airline boarding passes shown on a phone.

Barcode types at a glance

TypeKindHoldsWhere you see it
UPC-A1D12 digitsRetail, US and Canada
UPC-E1D8 digitsSmall retail packs
EAN-131D13 digitsRetail worldwide, books
EAN-81D8 digitsVery small packs
Code 1281DAny textShipping, logistics
Code 391DCapitals, digitsBadges, asset tags
Code 931DCapitals, digitsPost, components
ITF-141D14 digitsShipping cartons
Codabar1DDigits, symbolsLibraries, blood banks
GS1 DataBar1D14 digits plus extrasFresh produce, coupons
QR Code2DAbout 4,300 charactersLinks, payments, tickets
Data Matrix2DAbout 2,300 charactersHealthcare, electronics
PDF4172DAbout 1,800 charactersID cards, boarding passes
Aztec2DAbout 3,000 charactersRail and air tickets

Which one should you use?

If you are selling in stores, you do not get a choice: UPC-A in North America or EAN-13 elsewhere, with numbers licensed from GS1. For labeling your own stock, shelves or equipment, use Code 128. It takes letters, it is compact, and practically every scanner reads it. To send someone to a web page, use a QR Code. For something tiny, Data Matrix. For outer cartons, ITF-14.

The barcode generator makes all of these. For a closer look at the grid formats, read 2D barcodes explained.

Sources

Spotted a mistake? Email [email protected].

FAQ

Quick answers

What are the two main types of barcodes?

Linear (1D) barcodes, which are a single row of bars and hold a short number or code, and 2D barcodes, which are grids of cells and hold hundreds or thousands of characters. UPC, EAN and Code 128 are linear. QR Code, Data Matrix and PDF417 are 2D.

What is the most common type of barcode?

On products, EAN-13 worldwide and UPC-A in the US and Canada. In logistics, Code 128. For anything aimed at a phone camera, QR Code.

How can I tell which type of barcode I have?

Scan it with the online barcode scanner. The result names the type. By eye: 12 or 13 digits under tall guard bars means UPC or EAN, three corner squares means QR, an L-shaped border means Data Matrix, and a wide block of stacked rows means PDF417.

Which barcode type should I use for my products?

For retail sale, UPC-A in North America or EAN-13 elsewhere, using numbers licensed from GS1. For your own stockroom, where no outside scanner needs to read them, Code 128 is the practical choice because it takes letters and any length.