Barcode
The cashier passes a carton of milk over the scanner window, and a split second later the till beeps. The red beam has crossed 30 bars and 29 spaces, and the photodiode has seen 59 brightness transitions. The decoder unpacked them into 13 digits and checked the last one. If the carton is crumpled and a crease runs across a bar, there are 61 transitions and the till stays silent. The code is designed to refuse to read rather than read wrongly.
A barcode records a number in the widths of dark and light stripes. The widths are multiples of the module, the narrowest stripe. In EAN-13 every digit takes 7 modules: two bars and two spaces. The first digit has no bars of its own; it is hidden in which sets the left half is written in. The thirteenth digit is the check digit: it is calculated from the other twelve.
| What it is | an optical machine-readable code of parallel bars and spaces |
| Symbology | EAN-13 and UPC-A on goods, ITF-14 on cartons, Code 128 in logistics |
| Module | X = 0.330 mm at 100 %; 80–200 % is allowed, from 0.264 to 0.660 mm |
| Capacitance | 12 information digits and one check digit: 10¹² numbers |
| Protection | a check digit with weights 1 and 3; catches any single error |
| Read with | a 650 nm red laser with a photodiode, or a camera with illumination |
Etymology
A stroke from German, a book from Latin
The code was invented in the USA and named after its look: bar code, “striped code”. Other languages either took over the English word or translated it with their own roots. The Russian «штрих-код» is put together from German and Latin loanwords; standards write «штриховой код».
01 · Structure
Thirteen digits in 95 modules
The code is read from left to right by modules: 1 is dark, 0 is light. Guard patterns 101 stand at the edges and 01010 in the middle. Between them are six digits on the left and six on the right, 7 modules each. Each digit is two bars and two spaces, from one to four modules wide.
A digit can be written in three sets. Set L starts with a light module and has an odd number of dark ones. Set G is the mirror image of R and has an even number of dark ones. Set R is the negative of L and appears only on the right. From the alternation of L and G in the left half the scanner learns the first digit, and the direction too: the code can be swiped upside down.
How a digit becomes stripes
Choose a digit. Below is its pattern in three sets of 7 modules and the alternation of sets if this digit comes first.
Damage the code and see when the till gives up
Three experiments on one label. “Encoding”: change digits and watch which stripes are rebuilt. “Scanner”: move the beam, shrink the print, spread the ink, scratch. “Cashier error”: enter a number with a mistake and check whether the check digit catches it.
02 · Evolution of codes
From a circle in the sand to a square on a pack
Each new code answered one problem of the old one. The circle read from any side but printed badly. Coloured stripes on railway wagons faded. Numeric codes could not do letters. Linear ones held no more than a couple of dozen characters, and the code grew into a second dimension.
03 · Compression and capacity
Digits only, five lengths
A code compresses data by choice of alphabet. Code 39 spends 16 modules on any character because it also handles letters. Code 128 in set B puts a character in 11 modules, and in set C two digits at once. ITF hides the second digit of a pair in the spaces of the first. EAN-13 is the densest: it knows in advance that there are exactly 13 digits.
04 · What is encoded
A number, not a description
The code holds no name, no price and no expiry date. Only the GTIN, by which the till finds the product in its database. The first three digits are the prefix of the national GS1 organisation that issued the company number. It does not mean the country of manufacture: a factory in China can get a number in Germany, and an Argentine company one in the USA. Next come the company number and the item number, and the boundary between them floats. The last digit is the check digit.
05 · Printing rules
06 · Neighbouring codes
07 · Historical section
Norman Woodland, by his own account, thought up the code on a beach in Miami. He drew the dots and dashes of Morse code in the sand with his fingers and pulled them downward, which gave narrow and wide stripes. So that the mark could be read from any side, he bent the stripes into rings. In 1952 he and Bernard Silver received US patent 2 612 994.
There was nothing to read a circle with: the test needed a powerful lamp and a photomultiplier from a film projector. The code waited twenty years for cheap lasers and chips. In 1973 American retail chains chose the rectangular UPC, developed at IBM with Woodland's participation. The circles lost because of printing: on a moving press web the ink smeared them in one direction.
Catalogue of quantities
the whole index →The seven SI base units
A drop of acid changes the colour of the juice, salt colours the flame, water freezes at a tap. Below them are all Simetrium sheets, by discipline and alphabetically.
Open the index →





