The Surprising History, Math, and Future of the Humble Barcode

Andrei Mihai

On any given day, you probably pass by tens – if not hundreds – of barcodes. They beep and blink at the supermarket checkout, at the airport gates, and even in hospitals or libraries. These black-and-white lines are ubiquitous, unobtrusive, and quietly indispensable. And that is exactly the point.

Barcodes have become so mundane that we take them for granted. But this dull utility hides a story of technological innovation, economics, and – as it so often happens – a bit of serendipity.

Image via Wikipedia (‘CC BY 3.0‘)

In the late 1940s, Norman Joseph Woodland, a graduate student at Drexel Institute in Philadelphia, sat on a beach in Florida and dragged his fingers through the sand. Anyone passing by would have likely thought he was doodling. Yet, Woodland had a very specific idea in mind.

His friend Bernard Silver, also a graduate at Drexel, had recently overheard one grocery store executive asking one of the Drexel deans to research a system to find a way to speed up checkout lines. It was the postwar boom, still decades before computers were truly developed, and stores were struggling to track sales, restock efficiently, and manage growing inventories.

Woodland and Silver thought they could complete the challenge.

Their approach took inspiration from Morse code, a communication method that encodes text characters as sequences of two different signal durations, called dots and dashes. What if information could be conveyed in lines and dots, only in printed form?

“I just extended the dots and dashes downwards,” Woodland later said, “and made narrow lines and wide lines out of them.” The two took their idea even further, turning the barcode into a circle. The result, which looked a bit like a bull’s eye and had the advantage that it could be scanned equally well from any direction. They used adapted technology from soundtracks and a strong, 500-watt incandescent bulb to read the bar codes.

The two patented their invention in 1949. Yet, barcodes did not become a hit overnight. In fact, the invention languished for around two decades.

The bull’s-eye bar code introduced in Woodland and Silver’s 1949 patent. Image: U.S. Patent and Trademark Office.

An Invention Ahead of Its Time

Woodland and Silver were not the only ones thinking about this type of technology. Various companies and research groups were experimenting with their own optical scanning. While the two seemed to have the most efficient design, they had a big problem: the era’s hardware. Computers were too large, scanners too primitive, and printing methods too imprecise to make it viable. No one could scale the bar code throughout the 1950s.

It was only in 1966 that the National Association of Food Chains (NAFC) in the US decided to start implementing automated checkout systems. The time was right. Printers had become much better and laser scanners were available. By then, the bar code patent had been sold to RCA, but Woodland was still recruited to work on the implementation of bar codes.

The circular design was deemed impractical, and instead, linear barcodes were printed on small pieces of adhesive paper. Engineer George Laurer oversaw this process. It was decided that all products would have a unique, 11-digit code for identification (plus another check digit mathematically calculated from the first 11 digits to help scanners detect errors during reading). This code would be called UPC (Universal Product Code). A UPC consists of 6 digits assigned to the manufacturer or brand, and 5 digits are chosen by that manufacturer to represent a specific product – like a certain size of toothpaste or flavour of cereal. These 11 digits don’t contain pricing or descriptive information themselves, but they act as a key that links to a product’s full profile in a store’s database, which includes price, description, inventory data, and more.

The barcode would encode this information in a scannable form. Each digit in the UPC is translated into a specific arrangement of bars and spaces of varying widths, based on a standardized binary system.

Illustration of a UPC/EAN barcode, with guard bars highlighted in green and one digit highlighted in cyan and expanded to show individual bars. Image via Wikipedia (CC BY 3.0)

In June 1974, the bar code finally hit the main stage. A pack of gum was scanned, becoming the first commercial use of the UPC. Yet even then, the barcode seemed to be a gamble.

Economic studies from the NAFC projected over $40 million in savings to the industry from barcode scanning, but these savings did not materialize right away. In 1976, Business Week wrote about “The Supermarket Scanner That Failed,” referring to barcodes and scanners.

The missing piece was widespread adoption. The more products were labelled with barcodes and the more scanners became widespread, the more time and money was actually saved. Within a few years, the barcode truly took off.

It is impossible to assess exactly how much barcodes saved, but it is likely in the billions or tens of billions of dollars per year. The barcode scanner industry alone is worth over $2 billion. Billions of barcodes are read every day, and this humble invention plays a key role in modern society.

The Math and Inner Workings of Barcodes

Barcodes are deeply rooted in mathematics – especially in binary systems, geometry, and error detection algorithms. At their core, barcodes translate numbers into a visual code using patterns of black and white bars or shapes. Each bar’s width and spacing represent binary digits (0s and 1s), which computers and scanners decode using mathematical logic.

For example, a common barcode like the UPC uses a standardized binary encoding scheme where each digit from 0 to 9 is represented by a specific pattern of seven modules (bars or spaces). These patterns are designed with symmetry and redundancy to help machines read them accurately, even if the label is damaged or partially obscured.

Mathematics also powers the error-checking systems built into barcodes. Most barcodes include a check digit – a mathematically calculated number based on the rest of the code. When a scanner reads a barcode, it runs a quick algorithm to confirm that the code is valid. If the check fails, it knows there is a mistake.

The post The Surprising History, Math, and Future of the Humble Barcode originally appeared on the HLFF SciLogs blog.