Create an animated lesson
On requestThis article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.
How does a barcode work?
TechnologyLesson on requestFree to read
Quick answer
A barcode works by encoding a number as a pattern of black bars and white spaces of varying widths. A scanner shines light across it, measures the reflected pattern, and decodes it into the digits that identify the product. The bars and spaces represent digits; their widths form the code.
Step by step
- The bars and spaces represent digits; their widths form the code.
- A scanner's light reflects off the white spaces and is absorbed by the black bars.
- A sensor reads the pattern of reflections and converts it back to the number.
- That number is looked up in a database to find the product, price, and details.
- 2D codes like QR codes store far more data in a grid of squares.
People also ask
What do the numbers under a barcode mean?
They identify the manufacturer and product. The barcode is just a machine-readable version of those digits so a scanner can read them instantly.
Does the barcode contain the price?
Usually not — it holds a product ID. The price lives in the store's database and is looked up when the code is scanned, so prices can change without reprinting labels.
How is a QR code different from a barcode?
A barcode is one-dimensional (lines) and stores a small number; a QR code is two-dimensional (a grid) and can hold much more, like links and text.
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.
Part of the guide: Everyday Machines →

