1D vs 2D Barcodes: What's the Difference?

Barcodes fall into two broad families:

  • 1D (one-dimensional) barcodes encode data in a series of parallel vertical bars and spaces. They can only be read horizontally, and they hold a limited amount of data — typically 10–50 characters. Examples: Code 128, EAN-13, UPC-A, Code 39, ITF-14.
  • 2D (two-dimensional) barcodes encode data in a grid of squares or dots. They can be read in any direction and hold far more data — hundreds to thousands of characters. Examples: QR Code, Data Matrix, PDF417.

For most retail and warehouse use cases, a 1D barcode is all you need. 2D barcodes become useful when you need to pack more information into a small label, or when customers will scan the code with a smartphone.

The 7 Most Common Barcode Types

1D

Code 128

The workhorse of warehouse and inventory labeling. Encodes all 128 ASCII characters with high data density. No inherent length limit.

Generate Code 128 →
1D

EAN-13

The international retail standard. 13 digits, used on virtually every product sold outside North America. Required by most global retailers and GS1.

Generate EAN-13 →
1D

UPC-A

The North American retail standard. 12 digits, required for products sold in US and Canadian supermarkets, big-box stores, and Amazon FBA.

Generate UPC-A →
1D

Code 39

An older, simpler format used in automotive, aerospace, and government applications. Encodes letters and numbers. Self-checking — no check digit required.

Generate Code 39 →
1D

ITF-14

Used on outer shipping cartons (cases and pallets). Encodes 14 digits including a GS1 prefix. Printed directly on corrugated cardboard — no label needed.

Learn about ITF-14 →
2D

QR Code

The most recognizable 2D barcode. Stores URLs, contact info, plain text, or Wi-Fi credentials. Scannable with any smartphone camera — no dedicated scanner needed.

Generate QR Code →
2D

Data Matrix

A compact 2D format used in pharma, electronics, and small-part manufacturing. Can encode a lot of data in a tiny footprint — as small as 1mm × 1mm.

Generate Data Matrix →

Quick Reference: Which Barcode Type Should You Use?

Use Case Recommended Format Why
Selling in US / Amazon FBA UPC-A Required by US retailers and Amazon for most product categories
Selling internationally / EU EAN-13 Global standard; also accepted in the US (UPC-A is a subset of EAN-13)
Internal inventory / SKU labels Code 128 Most compact 1D format; encodes any alphanumeric SKU
Clothing & garment tags Code 128 or EAN-13 Code 128 for internal; EAN-13 if selling through retail channels
Shipping cartons / pallets ITF-14 GS1 standard for case-level barcoding; printable on corrugated stock
QR menus / URLs / contactless QR Code Customer-facing; smartphone-scannable without a dedicated reader
Pharma, electronics, small parts Data Matrix High data density in minimal space; used in GS1 healthcare standards
Automotive / government / DoD Code 39 Legacy standard in these industries; simple and self-checking

How Do Barcodes Work?

Every barcode encodes data as a pattern that a scanner can read optically. In a 1D barcode, the widths of the bars and the spaces between them represent digits or characters. A laser scanner bounces light off the barcode and measures how much is reflected — dark bars absorb light, white spaces reflect it — producing a digital signal that a decoder converts back to text or numbers.

2D barcodes work on the same optical principle but encode data in a two-dimensional matrix. An image sensor (camera) captures the entire pattern at once rather than scanning a single line. This is why your phone camera can read a QR code while it typically can't read a shelf barcode without a dedicated app.

Do I Need to Buy a Barcode?

For internal use (your own warehouse, inventory, or internal SKU tracking), you can generate any barcode you like — no purchase or registration required. The barcode is just a machine-readable label for your data.

For retail sale through major retailers or marketplaces like Amazon, Walmart, or Target, you typically need a GS1-registered UPC or EAN. GS1 is the nonprofit that manages the global barcode numbering system. You purchase a company prefix from GS1, which guarantees your product numbers are globally unique.

Amazon, for its part, accepts GS1-issued GTINs (Global Trade Item Numbers) or brand-registered ASINs. Using a recycled or "grey-market" UPC can get your listing suppressed.

Ready to generate barcodes? Our free bulk barcode generator supports all 7 formats above. Paste your SKUs or product list, pick a format, and download print-ready PDF labels — no signup required.

Generate Barcodes Free →

Choosing Between Code 128, EAN-13, and UPC-A

These three are the most commonly confused. Here's a quick distinction:

  • UPC-A is 12 digits, North America only (though globally accepted). It's a subset of EAN-13 — an EAN-13 with a leading zero is the same as a UPC-A.
  • EAN-13 is 13 digits, the global standard. If you're selling in Europe, Australia, Asia, or anywhere outside the US, use EAN-13.
  • Code 128 encodes any characters (not just numbers) and has no fixed length — making it ideal for SKUs like "SKU-2024-BLK-M" that mix letters and numbers.

If you're unsure, Code 128 for internal use, EAN-13 for retail is a safe default for most small businesses operating internationally.

What About QR Codes?

QR codes are excellent for customer-facing applications — linking to a product page, a how-to video, a Wi-Fi password, or a loyalty program sign-up. They're free to generate and require no registration.

They are not a substitute for retail barcodes. A supermarket's point-of-sale system expects a laser-scannable 1D barcode at the checkout, not a QR code. Use QR codes alongside — not instead of — your retail barcode.

Quiet Zones and Print Quality

Every barcode format requires a blank margin on both sides called a quiet zone. Without it, a scanner may fail to detect the start or end of the code and produce a misread. Our generator adds the correct quiet zone automatically for every format.

Print at a minimum of 203 DPI for laser/inkjet labels. For thermal printers, use a resolution of 300 DPI or higher for reliable scanning. Avoid printing barcodes on textured or glossy paper without a matte laminate, as reflected glare can cause misreads.