Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

A barcode is a visual code that stores information using patterns of dark and light regions. When a scanner shines a red laser or LED across the code, black bars absorb more light and white spaces reflect more light. The scanner turns these changing reflections into an electrical signal that can be decoded by a computer.

This makes checkout, shipping, inventory, and identification fast and reliable.

Understanding How Barcodes Store Information

A barcode does not usually hold a product name or a price. It holds an identification number. The store computer uses that number to find a matching record in a database.

This is why one item can have different prices at different shops without needing a different printed code. The rules for arranging the pattern are called a barcode symbology. In UPC codes, each digit is represented by a precise pattern made from small equal-width units called modules.

Special guard patterns mark the beginning, middle, and end. They help the reader find the direction and separate the digit groups.

A reader must do more than notice light and dark areas. It samples the pattern many times while the code moves past the sensor. Its electronics estimate where one module begins and ends, even when the printed label is slightly blurred.

The software then compares the measured widths with the allowed patterns for that symbology. A clean area around the code is important. This blank border is called the quiet zone.

Without it, nearby text, pictures, or package edges can be mistaken for part of the code. Wrinkles, glare, faded ink, and low printer resolution can make a scan fail.

The final digit in a UPC code provides a useful error check. The scanner first reads the other eleven digits. It adds selected digits, giving every other position extra weight.

For UPC, the digits in the odd positions are multiplied by three, then the remaining digits are added. The check digit is chosen so the total reaches the next multiple of ten. If a bar is damaged or a digit pattern is read incorrectly, the calculation often fails.

This does not prove every scan is correct. Some rare mistakes can still pass the test. It does stop many common reading errors before the computer accepts a wrong item number.

Students meet barcodes on food packages, library books, event tickets, shipping labels, and school equipment. Warehouses use them to track where an item has been stored or sent. A barcode works best when it identifies one thing consistently, while a database stores changing details such as stock level or price.

One-dimensional barcodes are compact and fast to read, but they have limited data capacity. Two-dimensional codes, such as QR codes, use a grid and can store much more information.

When learning this topic, pay attention to the difference between the printed pattern, the scanner measurement, the decoding rules, and the database lookup. These are separate steps in one complete information system.

Key Facts

  • A 1D barcode stores data as a sequence of bars and spaces with different widths.
  • Black bars reflect less light, while white spaces reflect more light.
  • Scanner signal pattern: dark region = low reflected intensity, light region = high reflected intensity.
  • Binary encoding uses two symbols, usually 0 and 1, to represent data.
  • UPC-A barcodes encode 12 digits, including a number system digit, manufacturer code, product code, and check digit.
  • A check digit helps detect errors by testing whether the scanned digits satisfy a fixed calculation rule.

Vocabulary

Barcode
A printed pattern of bars and spaces that represents information in a machine-readable form.
Scanner
A device that shines light on a barcode and measures the reflected light to read the code.
Binary data
Information represented using two possible values, commonly 0 and 1.
Check digit
An extra digit calculated from the other digits in a code to help detect scanning or typing errors.
Quiet zone
The blank space before and after a barcode that helps the scanner identify where the code begins and ends.

Common Mistakes to Avoid

  • Thinking the bars directly draw the product picture, which is wrong because the barcode usually stores an identification number that a database links to product information.
  • Ignoring the white spaces, which is wrong because both bars and spaces are part of the encoded pattern.
  • Assuming every barcode uses the same format, which is wrong because UPC, EAN, Code 39, QR codes, and other systems encode data differently.
  • Covering or trimming the quiet zone, which is wrong because scanners need the blank margin to detect the start and end of the barcode.

Practice Questions

  1. 1 A simple barcode uses a narrow module width of 0.33 mm. If one encoded symbol is 7 modules wide, what is the width of that symbol in millimeters?
  2. 2 A scanner samples a barcode and records the reflection pattern white, black, black, white, black, white. If white = 1 and black = 0, what binary sequence is recorded?
  3. 3 Explain why a barcode scanner needs a contrast between dark bars and light spaces, and describe what might happen if the barcode is printed with low contrast.