CPG Terms Explained, a series by Cyril Ovely

What Is a Barcode, and How Do Barcodes Work?

A barcode is a machine readable visual representation of data. The pattern of bars encodes a number that identifies a product, and when it is scanned, the system uses that number to look the product up. The barcode is the symbol. The number underneath it is the data.

The short answer

A barcode is not a database. It is a pointer. The pattern of bars encodes a string of digits, the scanner reads those digits, and the system uses them to find a record: the product description, the price, the stock level. Nothing about the product lives inside the barcode except its number.

On a CPG product, that number is almost always a GTIN, the global product identifier managed by GS1. In the US and Canada it is usually the 12 digit UPC form. Everywhere else it is usually the 13 digit EAN form. Both are flavors of the same numbering system, and both get printed as the same kind of black and white symbol.

That split between the number and the symbol is the single most important idea in product identification. It explains why the same pack carries several codes, why a barcode alone cannot tell you a price, and why retailers ask for numbers and artwork separately. This article covers the symbol side. The number side, UPC, EAN, and GTIN, gets its own treatment.

From Morse code to a pack of gum: a short history

The barcode took 26 years to travel from a hallway conversation to a supermarket checkout.

  • 1948: Bernard Silver, a graduate student at Drexel Institute in Philadelphia, overhears a food chain president asking the dean for a way to automatically read product information at checkout. Silver and his friend Norman Joseph Woodland take on the problem.
  • 1949 to 1952: Woodland's first workable idea extends Morse code into vertical bars of varying width. The pair files a patent in October 1949 and it is granted in October 1952 (US Patent 2,612,994), but the scanning technology of the era cannot make it commercial.
  • 1960s: The first large scale use is not retail at all. Railroads use a blue and red barcode called KarTrak to identify freight cars. By 1974 around 95 percent of the North American rail fleet is labeled, though the system is eventually abandoned for reliability reasons.
  • July 1972: RCA runs an 18 month field test of a bullseye style code at a Kroger store in Cincinnati.
  • 3 April 1973: The US supermarket industry selects IBM's Universal Product Code design as the single standard, ending the format wars.
  • 26 June 1974, 8:01 a.m.: The first commercial barcode scan, at a Marsh supermarket in Troy, Ohio. The item: a 10 pack of Wrigley's Juicy Fruit chewing gum, 67 cents. That pack of gum now sits in the Smithsonian.
  • 1976: Adoption is slower than promised. Business Week runs a cover story titled "The Supermarket Scanner That Failed." Sales of scanning systems only take off in the early 1980s.
  • 1981: The US Department of Defense mandates the Code 39 symbology for military logistics, pushing barcodes deep into industrial and warehouse use.
  • 2010s: QR codes and smartphones carry barcodes beyond the checkout, into payments, tickets, and marketing.

How a 1D barcode works

The classic barcode is one dimensional: a sequence of dark bars and light spaces of different widths, read in one direction.

  • Characters are width patterns. Each digit is represented by a fixed pattern of bars and spaces measured in modules, the thinnest unit of the code. The scanner measures the widths and translates them back into digits.
  • The anatomy of UPC-A. The standard retail barcode encodes 12 digits. Each digit takes 7 modules, and the full symbol runs to 95 modules and 30 bars once the guard patterns are included. The longer bars at each end and in the middle tell the scanner where the symbol starts, ends, and which way round it is.
  • Quiet zones are part of the code. The blank margins on either side of the bars tell the scanner where to start reading. Artwork that crowds the bars with text or graphics causes scan failures at the shelf.
  • The digits below are the same data. The human readable numbers printed under the bars exist so a cashier can key the code in when scanning fails. Barcode and number carry identical information in two forms.

How scanners read them

Scanning is a reflectance trick. Dark bars absorb light and light spaces reflect it, so a sweep across the symbol produces a timing pattern of reflections.

  • Laser scanners sweep a laser beam across the bars and read the reflection pattern. They are fast and tolerant of curved surfaces, but they only read 1D codes.
  • Imaging scanners take a small picture of the code and decode it in software. They read 1D and 2D codes, work at any orientation, and are now the default in most hardware.
  • Smartphones are imaging scanners with a camera and an app. The app decides which symbologies the phone can read.

Once decoded, the number is validated and passed to the system, which looks up the product record. The price is set in the store's system, not in the barcode. That is why the same pack can cost different amounts at different stores, and why a price change does not require new packaging.

For the technically minded: Model a barcode as an encoding layer over an identifier. The pipeline is capture, decode, validate, then key lookup, where the decoded GTIN becomes the join key across POS, inventory, and measurement systems. The symbol itself is disposable: the same GTIN can be printed as UPC-A, EAN-13, or encoded in a 2D code, and every version resolves to the same record. Print quality matters in practice. Damaged case labels and missing quiet zones are a common source of receiving and picking errors in distribution, which is why scan rates are worth monitoring like any other data quality metric.

1D vs 2D: when lines are not enough

One dimensional codes are simple and cheap to print, but they hold only a handful of characters and need a database behind them. Two dimensional codes store data in both directions.

  • Capacity. A QR code or Data Matrix code can carry hundreds to thousands of characters, enough to hold a serial number, a batch number, an expiry date, or a URL without any lookup.
  • Error correction. 2D codes include redundant data, so they keep reading even when partially damaged or dirty. Useful in rough logistics environments.
  • Phone readable. Any smartphone camera can read a QR code, which is why 2D codes dominate consumer facing uses: payments, boarding passes, campaigns, and product information pages.

In CPG, 1D codes still own the physical supply chain, retail units, cases, and pallets, while 2D codes grow in serialization, traceability, and consumer engagement.

The barcode formats you will meet in CPG

The symbol and the payload are separate choices. These are the combinations that matter in consumer goods:

FormatWhat it encodesWhere you see it
UPC-AGTIN-12Retail units in the US and Canada
UPC-EGTIN-12, compressedSmall packs in the US and Canada
EAN-13GTIN-13Retail units everywhere else
EAN-8GTIN-8Very small packs
ITF-14GTIN-14Case and carton level codes for warehouses
GS1-128GTIN plus batch, lot, expiry, and serial dataLogistics, healthcare, fresh food
Code 39Alphanumeric textIndustrial and military labeling, internal asset tags
Code 128High density alphanumeric textInternal SKU labels, shipping labels
Data MatrixSerial numbers, small payloadsElectronics, pharma, tiny components
QR CodeURLs, text, structured dataMarketing, campaigns, payments

Two things to notice. First, only some of these are global standards. UPC, EAN, ITF-14, and GS1-128 follow GS1 rules and work in every supply chain. Code 39, Code 128, and QR carry whatever the printing company chooses, including internal SKU codes that mean nothing outside that company. Second, the same underlying number can travel in different symbols: a GTIN-14 appears as ITF-14 on the case, and the same GTIN family appears as EAN-13 on the unit. Format follows the job, not the product.

Where scanning happens between brand and consumer

The barcode's job is to turn physical movement into data without typing. Every scan along the route to market is a data entry point:

  • Distributor receiving: case codes scanned at the dock confirm what actually arrived against the purchase order.
  • Van loading: cases scanned onto vans make the load manifest accurate before the route starts.
  • Field sales: reps scan or capture shelf codes to check stock, place orders, and audit availability.
  • Retail point of sale: the final scan, where the unit code resolves to a sale and inventory adjusts.

Each scan removes a manual entry and its errors. The more touchpoints that scan, the more accurate the picture of what is where, and code quality, print, placement, quiet zones, decides whether that chain holds together or breaks at the weakest label.

Common misconceptions

"The barcode contains the price." It contains a number. The system looks up the price. That lookup is why prices can change without new labels and differ between stores.

"The barcode is the product number." The bars are the symbol, and the digits printed below are the number. They carry the same data in two forms. When people say "send us your barcodes," they usually mean the numbers.

"Any camera can read any barcode." Symbologies matter. A laser scanner cannot read a QR code, and a phone app only reads the symbologies it supports. Field apps need to match the codes they will meet in the market.

"All barcodes are global standards." UPC and EAN follow GS1 rules and are unique worldwide. Internal codes in Code 39 or Code 128 are private to the company that prints them, and two companies can print the same internal code for different products without collision.

The takeaway

A barcode is a machine readable picture of a number, and the number is what does the work. The symbol captured a pack of gum in an Ohio supermarket in June 1974, and the same basic idea now moves products from factory to shelf billions of times a day.

The next question is what those numbers mean, where they come from, and who assigns them. That is the world of GTIN, UPC, and EAN, and it has more structure than most people expect. For a quick overview, see What Is a UPC / GTIN?

Sources and further reading


Lighthouse for CPG

See how Lighthouse turns these terms into retail execution

Lighthouse connects distribution, execution, trade, and supply into one system your commercial teams act on at the store and SKU level.

Request a demo
Cyril Ovely
Co-Founder and CTO, Vxceed

Cyril is the Co-Founder and CTO at Vxceed. With over two decades of experience in engineering and entrepreneurship, he focuses on building scalable SaaS solutions that transform demand chain execution and help businesses operate with greater agility in evolving markets.