Wide, narrow, wide
How Does a Shop Scanner Read a Barcode?
A barcode is a number written in stripes, and a scanner reads it by watching how much light bounces back.
-
Step 1 of 5
The stripes are digits.
Every digit is drawn as a fixed-width slot containing two bars and two spaces of varying widths. Read the widths and you have read the number.
-
Step 2 of 5
The scanner watches reflected light.
A beam sweeps across the label. Black bars absorb it and white gaps bounce it back, so the sensor sees a rapid on-off-on pattern as the beam crosses.
-
Step 3 of 5
The guard bars tell it where to start.
Extra bars at each end and in the middle mark the boundaries, and because the pattern is different at each end, a code scanned backwards is still readable.
-
Step 4 of 5
The last digit is a check on the rest.
The final digit is calculated from the other twelve by a fixed sum. If the digits read do not produce it, the scanner rejects the read and simply says nothing.
-
Step 5 of 5
The code holds no price at all.
It only identifies the product. The price lives in the shop's own computer, which is why the same tin can cost different amounts in two branches.
A 13-digit EAN code has to be scanned correctly in full or not at all — the check digit catches roughly nineteen out of twenty single-digit misreads.
The short version
A barcode is a number written as stripe widths, read by watching reflected light, with a final digit that checks the read was right.
Try it yourself
Cover the last digit under a barcode and read the stripes above it. The pattern for that digit is still there — the printed number is only for humans.
Topics