Home/Technologies/How Barcodes Work: Structure, Scanning, and Product Identification
Technologies

How Barcodes Work: Structure, Scanning, and Product Identification

Barcodes encode product identifiers using sequences of bars and spaces, allowing fast and accurate product recognition at checkout. Learn how barcodes work, what information they contain, and why they remain essential to retail, logistics, and inventory management.

Oct 27, 2026
6 min
How Barcodes Work: Structure, Scanning, and Product Identification

Barcode technology is a method of encoding information using black bars and white spaces of varying widths. Today, you'll find barcodes on nearly every product, from groceries to electronics. A scanner reads this sequence, converts it into a numeric code, and transmits it to a computer system for quick identification.

Importantly, a barcode does not store the product's name, price, or features. Instead, it contains an identifier that a checkout system uses to look up the relevant record in its database. This is why the same product can have different prices in various stores-even though the barcode remains unchanged on each package.

Let's explore how a barcode works, what the bars and numbers mean, and why this simple pattern of lines allows checkout systems to instantly recognize products.

What Is a Barcode and How Is It Structured?

A barcode is a graphical representation of data, encoded through alternating dark and light areas. Unlike plain text, this encoding is designed primarily for automatic reading by specialized equipment.

Each bar and gap has a specific width. It's the sequence-not just the number-of black lines that encodes digits or other characters.

Elements of a Linear Barcode

  • Black bars - the dark segments that form the coded sequence
  • White spaces - the light gaps between bars, which are also used for encoding
  • Start and stop patterns - special combinations that define the barcode's boundaries
  • Numbers below the barcode - the human-readable version of the encoded number

Barcodes also include quiet zones-blank areas at each end that help the scanner distinguish the barcode from surrounding packaging graphics.

An important feature is that relative bar width matters. This means barcodes can be printed in various sizes, as long as the proportions are maintained and they meet standard requirements for scanning.

How Does a Barcode Work and How Does a Scanner Read It?

The principle behind barcodes is the different light reflection from dark and light areas. White spaces reflect more light, black bars absorb most of it. This allows the scanner to recognize the pattern and convert it to digital data.

Barcode Reading Process

  1. Illumination: The scanner directs light onto the package or uses a camera to capture an image.
  2. Detection: An optical sensor registers the sequence of light and dark areas and measures their widths.
  3. Decoding: The built-in algorithm converts the sequence into digits or symbols according to the barcode standard.
  4. Product lookup: The checkout system receives the identifier and finds the corresponding product entry in the store's database.

For example, when you scan a carton of milk, the register receives a numeric code. The software matches it to a record that includes the product name, price, and other details, which are then displayed and added to your receipt.

The scanner doesn't identify the product visually or determine its price-it only reads the encoded identifier.

Modern scanners may use laser technology or cameras with image sensors. Camera-based models can read both linear barcodes and 2D codes such as QR codes.

What Information Does a Barcode Contain?

A typical product barcode contains a unique identifier used for inventory and search in information systems. One of the most common formats is EAN-13, which includes 13 digits.

EAN-13 Number Structure

  • GS1 prefix - initial digits that indicate the GS1 organization responsible for the number range (not necessarily the country of manufacture)
  • Company and product code - combination of digits identifying a specific product
  • Check digit - the final digit, calculated by a special algorithm to detect reading errors

For instance, two products by the same brand but in different volumes will typically have different barcodes. This allows the checkout to distinguish packages and apply correct prices.

Price, expiration date, and stock levels are not stored in the EAN-13 barcode. These details reside in the store's database and are linked by the product identifier.

The check digit further enhances system reliability. If a digit is misread, the check will likely catch the error and reject the code.

That's why barcodes remain a simple yet effective tool: instead of storing extensive product data on packaging, only a short identifier is needed for the system to retrieve all relevant information.

Types of Barcodes

Barcodes vary by the number of characters, encoding method, and application. Some are designed for retail products, others for warehouses, manufacturing, or freight logistics.

EAN-13, EAN-8, and UPC

In retail, the three most common formats are:

  • EAN-13 - 13 digits, widely used for product identification in international trade
  • EAN-8 - a shortened 8-digit format for small packages where a standard barcode won't fit
  • UPC-A - 12 digits, mainly used in the USA and Canada

All three formats enable fast product identification at checkout. Their main differences lie in number structure and the amount of encoded digits.

Code 128 and Other Formats

Outside retail, barcodes can encode not only digits but also letters and special characters.

Code 128 is used in logistics, warehouse management, and labeling shipping cartons. It allows for alphanumeric identifiers, ideal for tracking shipments and processing orders.

Code 39 is another format, found in industry and equipment tracking systems, supporting numbers, Latin letters, and a limited set of special symbols.

The choice of format depends on your needs: for product sales, EAN-13 is usually sufficient, while logistics and internal labeling may require more flexible systems.

How Is a Barcode Different from a QR Code?

Both barcodes and QR codes let devices read information without manual input, but they use different data encoding methods.

A standard barcode is linear: data is encoded as a sequence of bars and spaces. A QR code is a two-dimensional code, storing data both horizontally and vertically in a grid of small squares.

Main Differences

  • Data capacity: Linear barcodes typically store short identifiers, while QR codes can hold much more information.
  • Data type: QR codes can encode text, web links, or contact details. Linear barcode capabilities depend on format.
  • Reading devices: QR codes require devices that can process 2D images. Standard barcodes are compatible with laser scanners.
  • Damage resistance: QR codes support error correction, allowing partial recovery of damaged data.

However, QR codes don't fully replace standard barcodes. Linear formats are still preferred in checkout systems for their simplicity, standardization, and compatibility with retail equipment.

For a detailed explanation of 2D encoding, check out How QR Codes Work: Structure, Reliability, and Error Correction.

Conclusion

A barcode is a straightforward solution for automatic product identification, encoding data with bars and spaces of varying widths. The scanner recognizes the sequence, converts it to a digital identifier, and sends it to the checkout system to retrieve product information.

The main advantages are speed and accuracy. Barcodes automate sales, manage inventory, and track goods movement without manual data entry.

Despite the rise of QR codes and other marking methods, standard barcodes remain widely used thanks to their simplicity, low printing costs, and compatibility with retail equipment.

Tags:

barcode
barcode scanning
product identification
EAN-13
UPC
QR code
inventory management
retail technology

Similar Articles

Loading...
How Barcodes Work: Structure, Scanning & Product Identification