We were unloading groceries last weekend and got into a weirdly long conversation about barcodes. Specifically: why do some of the vertical lines stick out a little further at the top and bottom? We assumed it was aesthetic. It absolutely is not.
A standard UPC barcode has three sets of what are called guard bars. Two skinny ones at the far left and far right, and one in the middle. They're the reason a checkout scanner can read a can of soup whether it's right-side up, upside down, sideways, or being dragged across the glass at speed by a teenager who wants to go home.
The guard bars tell the scanner two things. First, where the actual data starts and stops (so it ignores the packaging around it). Second, which direction it's being read. If the scanner sees the end-pattern first, it knows the label is upside down and just reverses the numbers in software. That's it. That's the whole trick. No orientation sensors, no cameras thinking about it. Just a couple of extra-tall lines acting as bookends.
The first product ever scanned with a UPC barcode was a 10-pack of Wrigley's Juicy Fruit gum, in a Marsh Supermarket in Troy, Ohio, in June 1974. The gum was chosen on purpose. The team wanted to prove the system could handle something small and flimsy, not just big rigid boxes. That original pack of gum is now in the Smithsonian. The scanner cost around $4,000 in 1974 dollars, which is roughly the price of a used car today. Grocery chains only agreed to install them because the labor savings at checkout were enormous, but it took another decade before barcodes were on basically everything. Retailers were slow. Manufacturers didn't want to reprint packaging. Sound familiar to any tech rollout, ever.
The last number of any UPC isn't part of the product ID. It's a check digit, calculated from the other eleven numbers using a specific formula. If a scanner misreads a bar and the math doesn't add up, it just refuses the scan and beeps at the cashier to try again. This is why you almost never get charged for the wrong item because of a scanner glitch. The barcode is essentially self-auditing every single time. A 50-year-old encoding scheme, still catching its own errors billions of times a day, using math that fits on an index card. We think that's kind of beautiful.
If you've stumbled across a weird little origin story we should chase down for a future Friday, send it our way — we're always collecting them.
— Alexander & Amanda @ SBATC