How do barcodes work?
A barcode encodes data in a visual pattern that can be read by a scanner. Billions are scanned daily, enabling everything from retail transactions and airline boarding to package tracking and secure identification.
Scanners read barcodes by moving a laser or camera over the pattern, converting it into a digital signal. Barcodes come in two main types: 1D barcodes, which use parallel lines to store data horizontally, and 2D barcodes (like Quick Response (QR) codes), which store data both vertically and horizontally using a grid. Once scanned, the barcode's information is quickly retrieved from a computer database, allowing systems to identify, track, and manage items in real time.
Credit: Business Week, April 7, 1973.
From a failed bull's-eye to a global standard
In 1948, the first barcode design took the form of a circular "bull's-eye," intended to be scanned from any angle or orientation. But the technology needed to implement it on a larger scale — faster computing, reliable scanners and advanced materials — did not yet exist, limiting its early use.
In the 1970s, IBM researchers developed the Universal Product Code (UPC), the rectangular design now found on nearly every consumer good. Its first commercial scan took place in Troy, Ohio, on a pack of chewing gum.
While this marked the beginning of barcode use, NSF-supported scientific advancements in the years before the first scan helped build the foundation for the global adoption seen today, addressing some of the technology's early challenges.
From semiconductors to scanners
NSF-funded research contributed to the vital hardware — semiconductors used in light-emitting diode (LED) lighting and lasers — that make barcode scanning possible.
In the 1950s, NSF supported early breakthroughs in integrated circuits and transistors, solid-state physics, materials science, and chemical and electrical engineering, catalyzing the development of semiconductors, a group of materials that can act as both electronic insulators and conductors.
Their unique properties allow semiconductors to both create light (as LEDs or lasers) and detect it, converting photons to electrical signals to process information. These capabilities, coupled with advances in semiconductor manufacturing, enabled the use of semiconductor-based laser diodes and LEDs as the primary light sources for barcode scanners, where emitted light is reflected from the barcode and detected to read the pattern.
Each type of light source provides unique benefits, with laser diode scanners best suited for long-distance scanning and 1D barcodes and LED image-based scanners best used for short distances, reading both 1D and 2D designs.
Learn how laser technology is transforming physics and engineering.
Fuzzy logic creates clear results
In the 1960s, an NSF-funded researcher developed the concept of fuzzy logic — a method that enabled computers to process and interpret uncertain or ambiguous data. Unlike traditional binary "yes/no" logic, fuzzy logic allowed machines to work in degrees of uncertainty, just like people do when trying to identify a blurry object. Although not developed for barcodes, fuzzy logic proved critical to their widespread use.
As barcode usage spread beginning in the 1970s, ensuring accuracy became a key challenge, especially when codes were smudged or damaged. In the early 1990s, NSF researchers improved computer vision and optical character recognition by developing algorithms that used fuzzy logic to improve how scanners interpret damaged or poorly printed codes. These advances increased reliability and reduced the need for manual input, helping make barcode systems more practical on a large scale.
Building on these innovations, engineers developed new designs, such as QR codes, capable of storing more information in less space and expanding how the technology could be used.
A technology that keeps evolving
Today, barcode technology continues to advance and evolve. In the past decade, NSF's support has helped researchers explore opportunities to embed barcodes into physical items, such as textiles or 3D-printed items, as opposed to being printed on or attached to them, offering more durability and security.
Through the NSF Innovation Corps™ program, researchers are developing self-authenticating QR codes to prevent "quishing" attacks (phishing via QR codes), enhancing data privacy and cybersecurity.
NSF investments will continue to enhance and expand the capabilities of barcode technology, just as they have for decades, bolstering innovations that power modern commerce, communication, and security.
From viewing a restaurant menu to paying for parking or boarding a flight, scanning a QR code has become a common part of life. But QR codes aren't inherently secure: Scammers can create codes that masquerade as official sources but link to malicious websites. Learn how NSF-supported researchers are working to protect Americans from this risk.