Types of Barcodes: A Complete Guide (1D & 2D)

Stock Identification & Tech · 11 July 2026 · 13 min read
Types of Barcodes: A Complete Guide (1D & 2D)

There are dozens of barcode formats, and they divide into two families. 1D or linear barcodes — UPC, EAN, Code 128, ITF-14 — encode data along one axis and hold around 8 to 25 characters. 2D barcodes such as QR Code and Data Matrix use both axes and hold thousands.

This guide covers the formats you will actually meet, what each one holds, where it is used, and how to pick between them. The short version: if you sell through retail you will need a GS1 format whether you like it or not, and if you are labelling your own locations you can use whatever scans reliably.

The two families: 1D and 2D

Every barcode falls into one of two groups, and the distinction is not cosmetic.

1D barcodes — also called linear barcodes — are the familiar pattern of vertical bars and spaces. They encode data along a single axis, which is why they are wide and short. A 1D barcode is essentially a printed number. It holds an identifier, and everything else about the item lives in your database.

2D barcodes encode data in two directions, as squares, dots or hexagons. Because they use both axes they hold far more in far less space, and they can carry actual information rather than just a pointer — batch number, expiry date, serial number, a URL.

The practical differences:

  • Capacity. A typical 1D barcode holds around 8 to 25 characters. A 2D code can hold thousands.
  • Size. 2D codes pack more into a smaller footprint, which matters on small items and electronic components.
  • Damage tolerance. Most 2D formats include error correction and still scan with part of the code missing. A 1D barcode with a scratch through the bars is dead.
  • Scanner requirements. Laser scanners read 1D only. Imaging scanners read both. If your fleet is laser, moving to 2D means replacing hardware.
  • Scanning angle. 2D codes can usually be read from any orientation. 1D codes need roughly correct alignment.

Neither family is better. 1D is cheaper to print, universally readable and perfectly adequate for identifying a product. 2D earns its place when you need data travelling with the item rather than sitting in a system.

Common 1D (linear) barcodes

UPC-A — twelve digits, used on retail products primarily in North America. Encodes a company prefix, a product number and a check digit. If you sell into US retail, this is usually what is required.

UPC-E — a compressed six-digit version for products too small to carry a full UPC-A. Cans, small cosmetics, confectionery.

EAN-13 — thirteen digits, the international equivalent of UPC-A, used across Europe and most of the world. The extra digit is a country prefix. Modern retail scanners read both EAN and UPC without anyone noticing the difference.

EAN-8 — the compressed eight-digit version, same purpose as UPC-E.

Both UPC and EAN are administered by GS1, and this is the part that surprises people: you cannot invent your own. To put a genuine retail barcode on a product you buy a company prefix from GS1 and allocate numbers within it. Barcodes bought cheaply from resellers are often recycled prefixes from dissolved companies, and major retailers will reject them.

Code 39 — alphanumeric, variable length, and the oldest format still in wide use. It encodes A–Z, 0–9 and a handful of symbols. Its weakness is density: Code 39 barcodes get long quickly, which is why it has largely been displaced. Still common in defence, automotive and older internal systems.

Code 128 — alphanumeric, variable length, and considerably denser than Code 39. It encodes the full ASCII set across three subsets, and it is the workhorse of logistics. Carton labels, shipping labels, internal location labels. If you are labelling something inside your own operation and it needs letters as well as numbers, Code 128 is usually the right answer.

GS1-128 — Code 128 with a rulebook. It uses Application Identifiers, short numeric prefixes that declare what the next chunk of data means. (01) is a product code, (10) is a batch number, (17) is an expiry date. This is what lets a single barcode carry structured data that any GS1-compliant system can parse. Standard on pallet and carton labels in retail supply chains.

ITF-14 — fourteen digits, designed for outer cases and shipping cartons. Its thick bars survive printing directly onto corrugated cardboard, where a finer barcode would blur into unreadability.

Codabar — older, self-checking, still found in libraries, blood banks and some logistics applications. You are unlikely to choose it for something new.

Niche 1D formats you may still meet. A handful of older symbologies survive in specific industries because the equipment reading them was installed decades ago and works.

  • MSI Plessey — numeric only, used almost exclusively for retail shelf labels and inventory tags in some stores. It has no fixed length and weak error checking, which is why it never spread beyond that niche.
  • Pharmacode — a pharmaceutical packaging code, deliberately unlike everything else. It is designed to be read reliably at very high speed on a packaging line, even printed in unusual colours or orientations, and it encodes a small number rather than a product identifier. You will never scan one with a handheld gun.
  • Code 11 — numeric plus a dash, developed for telecommunications equipment labelling. Dense, with optional check digits, and essentially confined to that industry.
  • Standard 2 of 5 and Interleaved 2 of 5 — numeric only. Interleaved 2 of 5 encodes digits in pairs, which makes it roughly twice as dense as the standard version, and ITF-14 is the variant you actually meet on shipping cartons. The plain versions turn up in warehousing, photofinishing and airline ticketing.

The practical point is recognition rather than selection. If you are choosing a format for something new, none of these is the right answer. If you inherit one, it is usually because a scanner, a printer or a customer’s system expects it, and replacing the format means replacing the equipment around it.

Common 2D barcodes

QR Code — the square with three large corner markers. High capacity, strong error correction, and readable by any smartphone, which is why it escaped industry and became consumer-facing. In a warehouse context QR codes are useful where you want staff to scan with a phone rather than dedicated hardware, or where a code needs to link to instructions.

Data Matrix — square or rectangular, extremely dense, and the standard choice where space is tight. Electronic components, surgical instruments, pharmaceutical unit packs. Data Matrix can be read reliably at very small sizes and with significant damage, which is why it dominates direct part marking where the code is etched into the item.

PDF417 — a stacked linear format, wider than it is tall. High capacity, and used where a lot of data must travel on a document rather than an item. Driving licences, boarding passes, shipping manifests.

Aztec Code — similar capability to QR, with a distinctive bullseye centre and no required quiet zone around the edge, so it fits in tighter spaces. Common in transport ticketing.

MaxiCode — a fixed-size hexagonal format developed for parcel sorting, encoding destination data readable at speed on a moving conveyor.

GS1 DataMatrix — Data Matrix carrying GS1 Application Identifiers, the same structured approach as GS1-128 in a 2D format. Increasingly the standard in healthcare, where a single small code must carry product code, batch and expiry.

Quick comparison

The formats you are realistically choosing between:

  • UPC-A / EAN-13 — retail products. Required if you sell through retailers. Numeric only, fixed length, GS1-administered.
  • Code 128 — internal labelling, cartons, locations. Alphanumeric, variable length, dense, free to use.
  • GS1-128 — supply chain labels where batch, expiry or serial must travel with the goods.
  • ITF-14 — outer cases printed directly onto corrugated.
  • QR Code — anything a phone should scan, or where a code links to content.
  • Data Matrix — small items, tight spaces, direct part marking.

How to choose the right barcode

Work through it in this order.

Is it going through retail? If yes, the decision is made for you. You need a GS1 prefix and a UPC or EAN. Everything else is secondary.

Does data need to travel with the item? If your process depends on knowing batch or expiry at the point of scan — food, pharmaceuticals, anything with a recall risk — you need GS1-128 or GS1 DataMatrix. A plain product code means a database lookup, and a database lookup fails the moment the item leaves your systems.

How much room is there? Small items push you towards Data Matrix. Large cartons printed on rough board push you towards ITF-14.

What will scan it? Check your existing hardware before choosing anything 2D. Laser scanners cannot read 2D codes at all, and discovering that after printing is an expensive morning.

How rough is the environment? Cold stores, outdoor yards and anywhere with abrasion favour 2D formats with error correction, plus a label material chosen for the conditions. Thermal transfer outlasts direct thermal in heat and sunlight.

Who else needs to read it? If the code will be scanned by a customer, a carrier or a regulator, use a standard they already support. A clever internal format that nobody downstream can parse creates manual work at every handover.

One practical note that causes more grief than format choice: print quality. A correctly chosen barcode printed at the wrong size, without adequate quiet zone, or at too low a resolution will fail verification regardless. If scans are failing, check print quality before you conclude the format is wrong.

Getting a barcode for a product you sell

If you are putting a product into retail, the process runs through GS1 and there is no way around it.

You license a company prefix — a block of digits unique to your business. The length of the prefix determines how many products you can number: a shorter prefix gives you more capacity and costs more. A business with ten products does not need the same allocation as one with fifty thousand.

Within your prefix you assign each product a GTIN (Global Trade Item Number). This is the number the barcode encodes. Each distinct sellable variant needs its own — a different size, colour or pack quantity is a different GTIN. This is where most first-time allocations go wrong: a five-pack and a single of the same item are two products, not one.

A few rules that catch people out:

  • One GTIN per variant, permanently. Do not reuse a number when a product is discontinued. Retailer systems hold history, and a recycled number produces the wrong product on somebody’s shelf.
  • The check digit is calculated, not chosen. It is derived from the preceding digits and validates the scan. Any barcode generator will compute it.
  • Buying cheap barcodes is a false economy. Resellers offering numbers for a few dollars are usually reassigning prefixes from companies that dissolved. Major retailers verify prefix ownership against the GS1 registry and reject what does not match.
  • Register your numbers. Allocating a GTIN is not the same as publishing it to the GS1 registry. Retailers increasingly check.

For purely internal use — location labels, tote IDs, work-in-progress tracking — none of this applies. Generate Code 128 from your own numbering scheme and move on.

Printing, materials and why scans fail

Format choice gets the attention. Print quality causes the failures.

Print method. Direct thermal is cheaper and needs no ribbon, but the label fades with heat, sunlight and abrasion, so it suits short-life applications like shipping labels. Thermal transfer uses a ribbon, costs more, and lasts years — the right choice for location labels, asset tags and anything in a cold store or outdoors.

Resolution. A 203 dpi printer is adequate for most 1D barcodes at normal sizes. Small 2D codes and dense Data Matrix generally need 300 dpi or better. Printing a fine code on a coarse printer produces bars that merge.

Quiet zone. Every barcode needs clear space either side with nothing in it. For 1D formats the rule of thumb is at least ten times the width of the narrowest bar. Designers routinely crop it to fit a label, and the code then fails intermittently, which is worse than failing outright because nobody trusts the diagnosis.

Contrast and colour. Black on white is reliable. Dark blue on white usually works. Red is effectively invisible to older red-laser scanners, which read it as white. Avoid printing on reflective or transparent material without testing.

Size. Shrinking a barcode to fit is the most common cause of scan failure. Each format has a minimum practical size, and going below it does not fail cleanly — it fails one time in twenty, at the worst moment.

Placement. Consistency matters more than position. If the label is on the right end of every carton, pickers scan without searching. If it moves around, every scan costs a few seconds of hunting, which multiplied across a shift is real money.

Verification. Barcode verifiers grade print quality against a standard scale rather than simply reporting whether a scan succeeded. If you print at volume, or supply retailers who audit, a verifier pays for itself the first time it catches a bad run before it ships.

Matching scanners to formats

The barcode is half the decision. What reads it is the other half, and the two get chosen by different people at different times, which is how mismatches happen.

Laser scanners read 1D only. They are cheap, hard-wearing, and read linear codes quickly at distance. If your operation is entirely 1D and likely to stay that way, they remain a sensible choice.

Imagers (area imagers) photograph the code and decode the image. They read 1D and 2D, work at any orientation, and cope with codes on screens — useful when a driver presents a delivery note on a phone. They cost more and have largely become the default.

Long-range scanners read from several metres, which matters for racking labels scanned from a forklift. Standard scanners will not reach a label four levels up, and staff climbing to scan is both slow and a safety problem.

Fixed-mount scanners sit over a conveyor and read automatically. Worth it where volume is high and consistent; over-engineering for anything else.

Wearables — ring scanners and glove-mounted units — keep both hands free for picking. In a high-volume pick operation the seconds saved per pick add up quickly, though staff acceptance varies and it is worth trialling before committing.

Two things to check before buying anything:

  • Will it read what you actually print? Test with your own labels, printed on your own printer, in the conditions they will be used. A scanner that reads a crisp sample from the vendor may struggle with a real label on a cold, damp carton.
  • Does it integrate with your system? A scanner that decodes perfectly but cannot feed data into your WMS in the right format creates a manual re-keying step, which reintroduces every error you bought the scanner to remove.

If you are replacing hardware anyway, buy imagers even if you only use 1D today. The price gap has narrowed, and it removes the constraint that otherwise blocks any future move to 2D.

Where to go deeper

The one-line takeaway

Use UPC or EAN if you sell through retail, Code 128 for internal labelling, GS1-128 or GS1 DataMatrix when batch and expiry must travel with the goods, and check your scanners support 2D before committing to it.

Frequently asked questions

What is the difference between UPC and EAN? UPC-A is twelve digits and used mainly in North America. EAN-13 is thirteen digits and used internationally. They are administered by the same organisation and modern retail scanners read both, so the practical difference is which market you are selling into.

Can I create my own barcodes? For internal use, yes — Code 128 or QR codes generated from your own numbering cost nothing. For retail sale you cannot, because UPC and EAN numbers must be allocated from a GS1 company prefix that you license.

Which barcode holds the most data? Among common formats, PDF417 and Data Matrix hold the most relative to their size. QR codes hold a large amount but need more physical space than Data Matrix for the same payload.

Do 2D barcodes need special scanners? Yes. Laser scanners read 1D barcodes only. You need an imaging scanner for any 2D format, though imagers read 1D codes too, so they are the safer purchase if you are replacing hardware anyway.

What is a GS1 Application Identifier? A short numeric prefix declaring what the following data represents — (01) product code, (10) batch, (17) expiry date. It lets one barcode carry several structured fields that any compliant system can read without prior arrangement.

Which barcode should I use for warehouse location labels? Code 128 for most operations. It handles letters and numbers, it is dense enough for a compact label, and every scanner reads it. Use larger print and a durable label material for locations scanned from a distance or at height.

Is RFID replacing barcodes? No, and it has been about to for twenty years. RFID costs more per tag and earns that back where reading many items at once without line of sight saves real labour. For identifying a single item at a single point, a barcode remains cheaper and more reliable. Most operations end up running both.

How long do barcode labels last? Direct thermal labels fade within months in heat or sunlight and are best kept for short-life uses like shipping labels. Thermal transfer labels on a suitable facestock last years, which is what you want for racking and asset tags.

Why do my barcodes sometimes fail to scan? Usually print quality rather than format — insufficient resolution, an inadequate quiet zone around the code, poor contrast, or a label material unsuited to the environment. Verify a printed sample before committing to a run.

Warehouse Wise
Written by
↑ Back to top
Warehouse Wise

Warehouse Wise is a free, independent library of guides on inventory management, warehousing and fulfilment, written for the people actually doing the work — new warehouse and inventory staff, small and growing retail and ecommerce businesses, and anyone who holds stock and wants to understand it properly. Every guide explains the term, shows a worked example with real numbers where it helps, and stops. We are independent: we do not sell software or equipment, we take no commission on referrals, and our guides are not ranked by who pays us.