barcode
A barcode is a set of bars and gaps standing for a number a scanner reads back in one pass.
In more detail
The bars are the number, written so that a beam of light dragged across them can read it: wide and narrow, dark and light. There is nothing else in there — no name, no price. The number is a key, and what it is worth is whatever the shop or the warehouse has filed under it.
Most kinds end in a digit worked out from the ones before it. A scanner redoes that sum every time it reads a code and refuses the reading when it does not come out, which is what stops a smudge being taken for a different article.
What it does on a real document
Whether a code works is not a question the page can answer, and not one an eye can: only a scanner can. Every code the team publishes here is read back with a code reader and compared with what went in, before the page goes up.
Two things break a code on a finished document, and both happen after anybody looked at it: a code fetched as a picture and then resized, which thickens the bars unevenly, and a white margin somebody trimmed off to make it fit. Drawn into the page line by line, at whatever size the document is printed, neither can happen.
Where it comes from, and why
The idea was patented in 1952, as a bullseye of rings rather than as bars, and waited twenty years for a light cheap enough to read it. The first one over a till was a packet of chewing gum in an American shop in 1974 — the packet is in a museum, and the arrangement it started is now on nearly everything sold anywhere.