Barcode Ready
← Barcode Guides

Types of Barcodes: 1D and 2D Formats and Their Uses

Barcodes fall into two families. 1D (linear) barcodes are the familiar vertical bars that hold a short string of digits or characters. 2D barcodes, like QR codes, use a grid of squares and hold much more data. The right type depends on what you are labeling and who needs to scan it.

1D barcodes

A 1D barcode is read in a single line across the bars. Most hold under about 50 characters, and many are a pure number. Their strength is simplicity: any scanner reads them quickly, even cheap laser models.

UPC-A has 12 digits and is the retail standard in the United States and Canada. EAN-13 has 13 digits and is the retail standard everywhere else; ISBN book barcodes are EAN-13s. Code 128 is a compact, high-density symbology that can encode the full ASCII character set, which makes it the default for shipping labels and warehouse inventory. Code 39 is an older format using uppercase letters, digits and a few symbols, still common in industrial and government settings, ID badges and automotive parts. ITF-14 is a 14-digit code printed on cartons and cases, usually inside a thick border. GS1-128 is Code 128 with a structured layout for data like batch numbers, expiry dates and pallet IDs, used in logistics and healthcare.

2D barcodes

2D barcodes encode data in both directions, so they hold far more in less space and can include error correction that survives scratches and smudges. They need a camera-based scanner, which every smartphone has.

QR code is the best known, used for links, payments, Wi-Fi sharing and tickets. Data Matrix is a compact square code used on small parts, electronics and pharmaceuticals, where it can be marked directly on metal or plastic. PDF417 is a stacked-row code found on driver licenses and boarding passes, holding well over a kilobyte of data.

1D vs 2D vs 3D barcodes

The difference that matters is 1D against 2D. A 1D barcode holds data in one direction, so it is short and any scanner can read it. A 2D barcode holds data in two directions, so it holds more in less space and needs a camera. For a longer comparison with capacity and scanner details, see 1D vs 2D barcodes.

"3D barcode" is not a standard family in the way 1D and 2D are. The term is used loosely, for example for 2D codes that add color, or for codes that are raised or engraved so they can be felt or read on a curved part. When someone asks for a 3D barcode, find out which they mean; most of the time a 2D code such as a QR code or Data Matrix is what they need.

What is a 2D barcode?

A 2D barcode, such as a QR code, Data Matrix, Aztec or PDF417, is a pattern of squares or stacked rows. It can hold links, long text and error correction, and phone cameras read it from any angle. If you want to try one, point your camera at a QR code in the QR code scanner.

Where each type is used

BarcodeFamilyTypical useData it holds
UPC-A1DRetail products in North America12 digits
EAN-131DRetail products worldwide, books13 digits
Code 1281DShipping, inventory, asset tagsFull ASCII
Code 391DBadges, industrial, governmentUppercase, digits, a few symbols
ITF-141DCartons and cases14 digits
GS1-1281DLogistics with batch and date dataStructured fields
QR code2DLinks, payments, marketingThousands of characters
Data Matrix2DSmall parts, medical devicesUp to about 2,300 characters
PDF4172DIDs, boarding passesOver 1 KB

How to choose

When in doubt, ask the party who will scan the code which formats their system accepts. A beautiful barcode no one's scanner is set up to read is useless.

Generate any of them

Barcode Ready has a free generator for each of the common formats: UPC, EAN-13, Code 128, Code 39, ITF-14, GS1-128, QR code, Data Matrix and PDF417. The main barcode generator lets you switch between them. Everything is drawn in your browser and nothing is uploaded.

Printing tips that apply to all types

To read a barcode from a photo and see its type, use the barcode scanner or the barcode decoder.

Try it