Skip to content
Technology

How do barcodes work?

A barcode stores a number as a pattern of black bars and white spaces of different widths. A scanner shines light at it, reads the reflected pattern, and converts it back into the number — which a computer looks up to find the product.

See it in motion.
Watch a 2-minute animated lesson that shows exactly how barcodes works.
▶ Watch the visual lesson

Step by step

  • 1Bars and spaces of varying widths encode a number.
  • 2A scanner reads how light reflects off the pattern.
  • 3The pattern is decoded back into digits.
  • 4A computer matches those digits to a product and price.

Frequently asked questions

How does a barcode store information?
As a pattern of black bars and white gaps of different widths that represent a number.
How does a barcode scanner read it?
It shines light on the code and measures the reflection, decoding the pattern into digits.
What's the difference between a barcode and a QR code?
Barcodes store data in 1D lines; QR codes use a 2D grid, holding much more information.

Related topics