Types of Barcodes Explained: UPC, EAN, Code 128, QR & More

A plain-language guide to the barcode types used in inventory and retail: UPC, EAN, Code 128, Code 39, QR codes, and Data Matrix, with when to use each.

Types of Barcodes Explained: UPC, EAN, Code 128, QR & More

Not all barcodes work the same way. Retail shelves, warehouse bins, and shipping cartons each favor a different symbology UPC, EAN, Code 128, Code 39, QR, or Data Matrix depending on what data needs to be encoded and how it will be scanned. This guide breaks down the differences so you pick the right one instead of guessing.

By Tibeau De Grauwe, FounderUpdated September 2026

  • 25 products free
  • No credit card
  • 10-min setup

1D vs. 2D barcodes

Linear (1D) barcodes encode data as a series of parallel bars of varying widths, read left to right by a laser or camera scanner. They hold a limited amount of data (usually just a number or short alphanumeric string) but are fast to scan and universally supported by inexpensive hardware.

2D barcodes like QR codes and Data Matrix encode data in a grid pattern, both horizontally and vertically. They can hold hundreds of characters URLs, batch numbers, expiry dates, or serial numbers and can be read from any angle, even partially damaged, using error correction built into the format.

  • 1D: UPC, EAN, Code 128, Code 39 low data capacity, fast scan, universal hardware support
  • 2D: QR code, Data Matrix high data capacity, omnidirectional scan, phone-camera friendly

UPC and EAN: retail barcodes

UPC-A (Universal Product Code, 12 digits) is standard in the US and Canada; EAN-13 (European Article Number, 13 digits) is standard everywhere else, including for products sold internationally. Both are fixed-length numeric codes tied to a GTIN (Global Trade Item Number) that a business licenses through GS1.

You cannot invent a UPC or EAN for a product you plan to sell at retail or on major marketplaces the number must be registered so it uniquely and permanently identifies that product worldwide. If a supplier's product already carries a UPC or EAN, map it to your internal SKU rather than replacing it with your own code.

Code 128: the default for internal inventory

Code 128 is a high-density, variable-length 1D symbology that encodes any combination of letters, numbers, and some symbols. It is the most common choice for internal warehouse labels SKUs, bin locations, lot numbers because it needs no license, scans reliably on any 1D scanner, and fits a compact label.

Most inventory software, including StockFlow, generates Code 128 barcodes automatically from your item records. Because the code is tied directly to your SKU, reprinting a damaged label or adding a new item never requires manually assigning a new number.

Code 39: the older alphanumeric standard

Code 39 was one of the first alphanumeric barcode symbologies and remains common in manufacturing, defense, and some logistics systems that adopted it decades ago. It encodes uppercase letters, digits, and a handful of symbols, but is less data-dense than Code 128 the same string takes up more physical space.

Unless you are integrating with an older system that already standardized on Code 39, new inventory setups should use Code 128 instead it holds the same character set more compactly and scans just as reliably.

QR codes and Data Matrix: 2D codes for extra data

QR codes are the most widely recognized 2D symbology, scannable by any modern smartphone camera without a dedicated app. For inventory, they are useful when a single label needs to carry more than an identifier a batch number, expiry date, or a link to a product page or manual.

Data Matrix codes serve a similar purpose in a smaller footprint, which is why they are common on small parts, electronic components, and medical devices where label space is limited. Both formats include error correction, so a partially torn or smudged label can often still be read correctly.

  • QR: best for phone-camera scanning and consumer-facing labels
  • Data Matrix: best for very small labels with limited surface area

Which barcode type should you use?

For products you sell at retail or through major marketplaces, use the licensed UPC or EAN already assigned to the product. For internal warehouse and inventory labels bins, shelves, lot numbers use Code 128 generated from your SKU; it needs no license and scans on any standard hardware.

Reach for a QR code or Data Matrix only when you need to encode more than an identifier on a single label, such as a batch number and expiry date together, or when your team scans primarily with phone cameras rather than dedicated 1D scanners.

Generate the right barcode type for every item

StockFlow generates Code 128 barcodes from your item master and scans UPC, EAN, and QR codes with any phone camera no separate barcode software required.

No credit card required
Free Starter plan
Cancel anytime

Trusted by small businesses

What our customers say

Super Kind! Quick replies from their support and very easy fixes, changed the dashboard a bit and customized it. Also gave me 450 items extra on the free plan just for me. Highly recommend and again great service!

Erasable Trading AU

Best customer service! Stockflow's customer support is fast and extremely helpful. They assisted me with customization of the software to improve my experience as a user.

Justin M.

Co-Owner, Consumer Goods

Frequently asked questions

What is the most common barcode type for inventory?
Code 128 is the most common choice for internal inventory labels. It encodes any SKU or alphanumeric string compactly, requires no licensing, and scans reliably on standard 1D scanners and phone cameras.
What is the difference between UPC and EAN?
UPC-A is a 12-digit code standard in the US and Canada; EAN-13 is a 13-digit code standard internationally. Both are retail barcodes tied to a licensed GTIN from GS1 you cannot generate a valid UPC or EAN yourself for a product sold at retail.
Can I use a QR code instead of a UPC for retail products?
No most retail point-of-sale systems and marketplaces require a standard UPC or EAN for checkout scanning. QR codes are useful as a supplementary code (for a warranty page or product info) but do not replace a required retail barcode.
Do I need a license to use Code 128 barcodes?
No. Code 128 is an open, unrestricted symbology. You can generate and use it for internal SKUs, bin labels, or lot numbers without registering anything, unlike UPC/EAN, which require a licensed GTIN from GS1.
Which barcode type holds the most data?
QR codes and Data Matrix (both 2D symbologies) hold far more data than 1D codes like UPC, EAN, or Code 128 up to a few hundred characters versus a short fixed number or string. Use a 2D code when a single label needs to carry more than an identifier.
What barcode type should I use for small parts?
Data Matrix is designed for very small labels since it packs data into a compact square grid. If label space is not a constraint, Code 128 remains simpler to generate and scan with common hardware.