Inventory Guide

What Is a Barcode? How Barcodes Work and Common Types

A barcode is a machine-readable representation of data. A scanner or camera reads the pattern, decodes its value, and sends that value to software. The barcode usually identifies a product, asset, shipment, location, or web address; price, stock, and descriptive details normally live in the connected database.

How does a barcode work?

A barcode converts characters into a visual pattern defined by a symbology. One-dimensional codes use bars and spaces. Two-dimensional codes arrange data in a matrix of squares, dots, or other shapes.

  1. Assign a value. This might be a GTIN, internal SKU, serial number, shipment ID, asset ID, or URL.
  2. Encode it. Software generates a symbol using rules for UPC-A, EAN-13, Code 128, QR Code, Data Matrix, or another type.
  3. Print or display it. Size, contrast, resolution, quiet zones, surface, and print quality affect readability.
  4. Scan it. A laser, imager, or camera captures and decodes the pattern.
  5. Look up the record. POS, inventory, warehouse, or asset software uses the value to find the matching record.

A barcode does not usually contain a product's price. A retail code commonly carries an identifier. The POS retrieves the current name, price, tax rule, and inventory record from its database.

Identifier, barcode, and product record

  • Identifier: the value assigned to the item, such as a GTIN or SKU.
  • Data carrier: the barcode symbol that encodes the value.
  • Database record: the information retrieved after scanning.

This distinction matters: printing the same valid barcode on two products still creates a data problem because software cannot determine which product moved.

1D vs. 2D barcodes

Characteristic1D2D
AppearanceParallel bars and spacesSquares, dots, or cells
CapacityShort identifiersMore data in a compact symbol
ExamplesUPC, EAN, Code 128, ITF-14QR Code, Data Matrix
ReaderLaser or image scanner2D imager or compatible camera

“Barcode” is the broad category. A QR Code is a specific two-dimensional barcode.

Common barcode types

TypeTypical use
UPC-A12-digit GTIN on consumer products, especially at North American retail checkout.
EAN-1313-digit GTIN used globally for retail trade items.
Code 128Alphanumeric internal SKUs, inventory, shipping, and logistics.
GS1-128GS1 identifiers with structured lot, date, quantity, and logistics data.
ITF-14Shipping cases and corrugated packaging not usually scanned at retail POS.
Code 39Industrial, government, and legacy asset applications.
QR CodeURLs, mobile experiences, documents, and some product applications.
Data MatrixSmall parts, healthcare, manufacturing, and direct-part marking.

The right type depends on the identifier, scanning environment, capacity, label size, surface, equipment, industry rules, and trading-partner requirements.

UPC, EAN, GTIN, and barcode

A GTIN is a Global Trade Item Number used in the GS1 system. A UPC-A symbol commonly carries a GTIN-12, while an EAN-13 symbol carries a GTIN-13. People often call both the number and symbol a “UPC barcode,” but the identifier and its machine-readable carrier are distinct.

GS1 is the official source for GS1 GTINs and EAN/UPC standards. A business selling through retail channels should obtain identifiers through GS1 and confirm each partner's requirements. Rendering a random 12-digit number as UPC-A does not make it an officially assigned GTIN.

Barcode vs. SKU

An SKU is an internal stock identifier. A barcode is a machine-readable carrier. A business can encode an alphanumeric SKU in Code 128 for internal use and also store an official UPC or EAN on the same product record.

What information can a barcode store?

A Code 128 inventory label may encode only COF-BEA-ETH-1KG. A UPC-A carries a GTIN-12. GS1-128 and GS1 DataMatrix can structure identifiers and attributes such as lot number, serial number, or date. A QR Code can contain a URL or text. For most inventory systems, a stable identifier linked to a database is simpler than packing changing product data into the symbol.

Anatomy of a reliable barcode

  • Encoded data represented by the pattern
  • Start and stop patterns used by some symbologies
  • Check digit or character for error detection
  • Quiet zone of blank space around the symbol
  • Human-readable text for manual fallback
  • Required dimensions for reliable scanning

Do not crop the quiet zone, stretch a code disproportionately, place it on a busy background, or assume one successful phone scan proves production quality.

How to choose a barcode

Start with destination requirements

If a retailer, marketplace, logistics partner, healthcare system, or regulator specifies a format, follow it.

Use Code 128 for many internal labels

Code 128 suits alphanumeric SKUs when the scanner and inventory or POS software support it.

Use EAN/UPC for retail checkout when required

Products entering general retail distribution commonly need official GTINs encoded in EAN/UPC symbols.

Use 2D when the workflow needs it

QR Code, Data Matrix, or GS1 DataMatrix can carry more data or fit particular environments. Scanner compatibility matters.

The free Stash barcode and label generator supports internal label workflows. It does not issue official UPC, EAN, or GTIN identifiers.

How to set up barcode inventory

  1. Clean the catalog and give every stocked variant its own record.
  2. Choose whether scanning will use an SKU, manufacturer barcode, official GTIN, or another controlled value.
  3. Select a compatible symbology, scanner, label, and software workflow.
  4. Generate labels with proper contrast, size, quiet zones, and readable text.
  5. Map each scanned value to one intended product and unit.
  6. Test representative labels on every device and surface.
  7. Use scanning inside controlled receiving, sales, count, transfer, and picking processes.
  8. Audit duplicate mappings, damaged labels, unknown codes, and manual overrides.

Scanning reduces typing but cannot fix dirty product data or missing stock movements. Pair it with a reliable receiving process and regular physical inventory counts.

Why a barcode may not scan

  • The scanner does not support the symbology.
  • The code is too small, dense, blurred, or distorted.
  • The quiet zone is cropped or covered.
  • Contrast is poor or the surface creates glare.
  • The printer has missing dots or incorrect settings.
  • The label is curved, wrinkled, dirty, wet, or damaged.
  • The scanner reads correctly, but software has no matching record.
  • A scanner prefix, suffix, or leading-zero setting changes the value.

First confirm the exact characters returned by the scanner. Then verify that the identical value exists on the intended product record.

Frequently asked questions

What is a barcode?

A visual, machine-readable representation of data decoded by a scanner.

Does a barcode contain the price?

Usually not. It commonly carries an identifier, while the POS retrieves the current price.

What is the difference between a barcode and UPC?

A barcode is the carrier. A UPC commonly refers to a GTIN-12 encoded in a UPC-A symbol.

Is a QR Code a barcode?

Yes. It is a two-dimensional barcode.

Can I make my own barcode?

You can generate internal labels from controlled values. Official retail GTINs follow GS1 rules.

Which barcode is best for inventory?

There is no universal best. Code 128 is common internally; EAN/UPC is common for retail trade items.

Can two products have the same barcode?

Not when the system must distinguish them. Duplicate mappings cause incorrect transactions.

Can I use an SKU as a barcode value?

Yes. Alphanumeric SKUs can often be encoded in Code 128.

Do barcodes guarantee inventory accuracy?

No. Accuracy still depends on clean data and correctly recorded movements.

How do I create labels from SKUs?

Prepare unique SKUs, encode each in a compatible type, print, and test with the real system. Use the free Stash barcode generator.

Create labels and keep inventory connected

Create product codes with the free SKU generator, then turn them into labels with the free barcode generator. For ongoing stock, purchasing, suppliers, forecasting, and multiple locations, explore Stash inventory management.

Sources and standards

Last reviewed: August 9, 2026.

Turn better inventory decisions into a better operating system

Stash connects inventory tracking, forecasting, purchasing, suppliers, and multi-location visibility so growing physical businesses can act on the numbers with less manual work.

Start free trial