How Bar Codes Are Read By Lasers

Photo: Garrison Gao / Pexels
A laser barcode scanner never "sees" a barcode the way a camera does. It fires a low-power beam across the pattern of black bars and white spaces, measures how much light bounces back at each instant, and hands that fluctuating signal to a decoder that reconstructs a number from nothing but timing. No shape recognition, no image processing in the classic sense — just reflectance converted into voltage, and voltage converted into digits. That process, refined over roughly 25 years between a 1952 patent and its first commercial checkout scan, is why a barcode reads correctly in a fraction of a second even when the label is slightly crumpled, held at an angle, or moving past the scanner window at a swipe's speed.
The idea that took 22 years to become useful
The barcode's origin story starts well before any laser existed to read one. In 1948, Bernard Silver, a graduate student at the Drexel Institute of Technology in Philadelphia, overheard a supermarket executive asking a dean for help building a system that could automatically capture product information at checkout. Silver brought the problem to a classmate, Norman Joseph Woodland, and the two spent the next few years experimenting with ways to encode data in a machine-readable pattern.
Woodland's breakthrough, according to accounts collected by the Smithsonian and the barcode industry's own historical record, came while he was sitting on a beach drawing lines in the sand with his fingers — he realized that Morse code's dots and dashes could be stretched into wide and narrow lines, and that a beam of light sweeping across those lines would produce a signal a machine could interpret. Woodland and Silver patented the concept as U.S. Patent 2,612,994, filed in 1949 and granted on October 7, 1952, describing both a linear bar pattern and a circular "bullseye" variant.
Bullseye barcode — Woodland and Silver's original 1952 design, a set of concentric circles rather than parallel bars, intended to be scannable from any rotation angle. It never reached mass production because printing presses of the era smeared circular ink patterns too easily, but it anticipated the omnidirectional problem that 2D codes would later solve differently.
The patent sat mostly unused for two decades. The missing piece wasn't the code, it was the reader: cheap, reliable, small light sources capable of sweeping a beam fast and precisely enough to resolve narrow printed lines didn't exist yet. That changed with the commercial helium-neon gas laser and, later, compact solid-state diode lasers, which gave engineers a light source stable and narrow enough to make optical scanning practical and affordable for a retail checkout counter rather than a research lab.
The commercial payoff arrived on June 26, 1974, at a Marsh Supermarket in Troy, Ohio, when cashier Sharon Buchanan scanned a 10-pack of Wrigley's Juicy Fruit chewing gum, purchased by Marsh's head of research and development, Clyde Dawson — an item chosen partly because it was small and partly, as often retold, because Dawson wanted to make sure something modest could still be read reliably (Smithsonian Magazine, 2019; History.com). That pack of gum is now in the collection of the Smithsonian's National Museum of American History. The industry standardized on the Universal Product Code (UPC) that same era, a format still printed on the majority of retail packaging worldwide five decades later.
What the bars and spaces actually encode
A UPC-A barcode encodes a 12-digit number, not letters or arbitrary text, using a strict grammar of bar and space widths. Each digit is represented by two bars and two spaces whose combined width equals seven "modules," the smallest printable unit in the symbology, arranged in one of ten fixed patterns depending on the digit's value and which half of the code it sits in.
That last detail matters more than it looks. The left half of a UPC code uses one set of ten digit patterns and the right half uses their structural inverse, so a scanner can tell, from the pattern alone, whether it's reading the code left-to-right or right-to-left. That's what lets a cashier swipe an item across a scanner window in any direction and still get a correct read; the decoder simply flips the digit sequence if it detects it started from the "wrong" end.
Every UPC-A code also carries a twelfth digit, the check digit, computed from a fixed arithmetic formula applied to the preceding eleven. The scanner's firmware runs that same formula on whatever digits it decodes and rejects the read outright if the result doesn't match. This single step is why a smudged, torn, or partially obscured barcode is far more likely to fail to scan at all than to scan as the wrong product — the checksum acts as a built-in lie detector for the decoded number, catching the overwhelming majority of print defects and partial reads before they reach the point-of-sale system.
| Symbology | Data type | Typical capacity | Error correction | Common use |
|---|---|---|---|---|
| UPC-A | Numeric only, 12 digits | Fixed 12 digits | Single check digit (modulo-10) | US/Canada retail products |
| EAN-13 | Numeric only, 13 digits | Fixed 13 digits | Single check digit (modulo-10) | International retail (GS1 global standard) |
| Code 128 | Full ASCII (letters, numbers, symbols) | Variable, dozens of characters | Single check character | Shipping labels, logistics, GS1-128 |
| QR code | Numeric, alphanumeric, binary, kanji | Up to ~7,089 numeric characters (Version 40) | Reed–Solomon, up to ~30% damage tolerance | Mobile payments, marketing, product links |
Linear codes like UPC and Code 128 trade capacity for print simplicity; 2D codes like QR trade printing complexity for far higher data density and built-in damage tolerance.
How the laser turns bars into a voltage signal
Inside a laser barcode scanner sits a small laser diode, typically emitting well under 5 milliwatts of power, a level the FDA classifies for handheld retail scanners as safe for incidental eye exposure under normal use. That beam doesn't stay still. It's aimed at a rotating polygonal mirror or an oscillating flat mirror, spinning or swinging fast enough to sweep the beam across the barcode dozens to hundreds of times per second, which is why the classic supermarket scanner produces that distinctive fan of crisscrossing red lines.
As the beam sweeps, it hits alternating black bars and white spaces. Black ink absorbs most of the incident light; white background reflects a large fraction of it back toward the scanner. A photodiode positioned to collect that reflected light converts the returning intensity into a continuously varying electrical voltage — high when the beam is over a reflective space, low when it's over an absorptive bar.
Pulse-width decoding: turning timing into digits
Because the mirror sweeps at a known, constant angular velocity, the amount of time the beam spends crossing any single bar or space is directly proportional to that bar or space's printed width. The scanner's onboard circuitry measures the duration of each high and low voltage segment, a technique called pulse-width decoding, and matches the resulting sequence of durations against the known table of UPC digit patterns. Widen a bar, and the corresponding voltage pulse simply lasts longer; the decoder never needs to know anything about pixels, edges, or geometry, only elapsed time between voltage transitions.
This is the core reason laser scanning stayed dominant in retail for decades even after cameras became cheap: pulse-width timing against a one-dimensional sweep is computationally trivial, requiring only simple analog and digital electronics rather than a full image-processing pipeline. A 1980s-era scanner could decode a UPC code with a fraction of the processing power a modern smartphone camera uses just to focus.
Why laser scanners can't read QR codes, and what replaced them
A laser scanner fundamentally reads one line at a time. Sweep the beam across a UPC code and you get a single one-dimensional slice of black-and-white transitions, which is all a linear barcode needs since its entire message is encoded along one axis. A QR code stores information in a two-dimensional grid of black and white squares, encoding data both horizontally and vertically at once — a single laser sweep across a QR code would only ever capture one row of that grid, missing everything above and below it.
Reading a 2D code requires capturing the whole pattern as an image and processing it with software, which is exactly what CCD (charge-coupled device) and CMOS camera-based scanners do. Instead of a sweeping laser and a single photodiode, these scanners use an image sensor, the same underlying technology in a digital camera, to capture the entire barcode area at once, then run image-recognition software to locate the code's finder patterns, correct for skew and rotation, and extract the encoded data.
This shift has largely displaced dedicated laser hardware in newer retail and logistics equipment. Camera-based scanners can read a laser scanner's linear codes and QR/2D codes with the same hardware, tolerate more damage and lower contrast because software can compensate computationally, and read codes displayed on a phone screen, something a laser scanner struggles with because screen glare and pixel refresh interfere with clean reflectance readings. Laser scanners persist mostly where their advantages still matter, in high-speed conveyor-belt scanning at distances and angles that favor a simple sweeping beam over a fixed-focus camera.
How the checkout scanner reads a barcode from any angle
A handheld laser scanner has one job: produce a single sweeping line and hope the cashier holds the barcode roughly perpendicular to it. A fixed in-counter supermarket scanner, the kind built into the checkout surface itself, can't rely on a shopper to orient anything. It has to read a barcode held sideways, tilted, or dragged past the window at almost any angle, which is a fundamentally harder problem than reading a single straight line.
The solution most in-counter scanners use is a holographic scanning disc, a rotating component etched with multiple facets, each cut at a slightly different angle. As the disc spins, the single incoming laser beam is deflected by each facet in turn along a different path in three-dimensional space, so instead of one sweep the scanner produces a dense crisscrossing pattern, often described in the scanning-hardware patent literature as a set of scan lines covering horizontal, vertical, and diagonal orientations at multiple depths of focus simultaneously (USPTO patent 6,085,980, "Holographic laser scanning system"). That's the source of the dense red starburst pattern visible above a supermarket checkout scanner window: it isn't decoration, it's dozens of independent scan lines running at once, each a candidate to be the one that happens to cross the barcode cleanly.
The decoder doesn't need every line to succeed. It only needs one line, out of the many crossing the code from different angles, to produce a checksum-valid read, which is why a barcode dragged quickly and carelessly across the window in almost any orientation still tends to register almost instantly. This is the same principle as the single-beam pulse-width decoding described above, just multiplied across dozens of simultaneous line angles instead of relying on one sweep repeated many times per second (madehow.com, "Bar Code Scanner").
Why some checkout scanners still fail on foil or curved packaging
Even an omnidirectional multi-line scanner depends on the same reflectance physics as a handheld unit: it needs a clean, diffuse difference between the light bounced back from bars and spaces. Foil packaging, shrink-wrapped curved surfaces, and glossy laminate labels can specularly reflect the laser, bouncing it away from the photodiode entirely rather than scattering it back, or overwhelming the sensor with a mirror-like glare that swamps the actual bar-and-space signal. That's a physical limitation of laser reflectance scanning, not a software bug, and it's one of the reasons camera-based imaging scanners, which can apply computational contrast correction across a captured image, have displaced laser hardware fastest in industries that package products in foil or curved plastic, such as pharmaceuticals and cosmetics.
The GS1 standard and why barcodes don't collide worldwide
A barcode is only useful if the number it encodes means the same thing to every scanner and every database that reads it. That coordination job belongs to GS1, a global nonprofit standards organization formed from the merger of European and North American barcode governing bodies, which issues company prefixes to manufacturers and retailers and maintains the technical specifications for UPC, EAN, Code 128 (in its GS1-128 form), and GS1's own QR code implementation.
When a manufacturer registers with GS1, it receives a company prefix, a block of leading digits reserved exclusively for that company's product numbers. The manufacturer then assigns the remaining digits internally to specific products, and the check digit is calculated last to complete a valid, globally unique code. This is why a barcode printed on a product in Germany and one printed on an unrelated product in Ohio will never decode to the same 12- or 13-digit number, despite being created by entirely separate companies with no direct coordination between them — the prefix system alone prevents the collision.
GS1 also governs Code 128 and its logistics-focused variant GS1-128, which unlike UPC can encode full ASCII text, not just digits, making it suitable for shipping labels that need to carry batch numbers, expiration dates, and serial numbers alongside a product identifier. That flexibility comes at a cost: Code 128 patterns are more visually complex per character than UPC's fixed digit patterns, so labels using it tend to be physically longer for equivalent information density.
How does a barcode work without wireless or a battery?
A barcode is entirely passive. It contains no electronics, no power source, and no radio components; it's simply printed ink and paper (or a printed label on packaging). All of the "work" happens in the scanner, which supplies the light, measures the reflectance, and runs the decoding logic. That's fundamentally different from technologies like NFC payment chips, which require an embedded antenna and, in active-tag configurations, their own power source to communicate.
What people get wrong about barcode scanning
A common misconception is that a barcode scanner reads the printed numbers below the bars, the way a person would. It doesn't. Those digits exist as a human-readable backup, printed so a cashier can key in the number manually if the scan fails; the scanner itself never processes that text and has no optical character recognition step in a standard laser or CCD unit.
Another frequent assumption is that barcode failures mean the scanner "can't see" the code, when in most cases the real culprit is contrast, not visibility. Reflectance-based decoding depends on a sharp difference between the black bars and white background; a barcode printed on shiny, glare-prone plastic, faded from sun exposure, or printed in low-contrast color combinations (red ink on a white background, for instance, can be nearly invisible to some laser wavelengths because red-light lasers don't distinguish red ink well from the white beneath it) will fail to scan cleanly even when it's perfectly legible to a human eye. This is a known design constraint, not a scanner malfunction: red helium-neon and diode lasers, historically the most common in retail scanners, are poor at resolving red or orange printed elements for exactly this physical reason.
A third misconception concerns speed: people sometimes assume a scanner is somehow "reading" the whole barcode instantly in one glance. In reality, a laser scanner sweeps the beam across the code many times per second specifically because a single sweep can miss the code entirely if the angle is wrong or the beam crosses only part of the pattern. What looks instantaneous to a shopper is actually dozens of scan attempts happening within a fraction of a second, with the decoder accepting the first sweep that produces a checksum-valid result and discarding the rest.
Barcode scanning is also sometimes confused with related but distinct technologies. It shares no mechanism with the color-sensing photosites in a digital camera, which measure red, green, and blue light intensity across a full 2D image rather than binary reflectance along a swept line, and it works on an entirely different physical principle than active noise cancellation in headphones, which processes sound waveforms rather than light reflectance, despite both technologies relying on real-time signal processing of a continuously varying analog signal.
The takeaway
A laser barcode scanner's entire trick is reducing a printed pattern to a single measurable quantity, reflected light intensity over time, and then decoding that timing against a known table of digit patterns protected by a checksum. That reduction is what makes the process fast, cheap, and durable enough to survive five decades of retail use essentially unchanged in principle, even as the underlying hardware shifted from spinning mirrors and helium-neon tubes to solid-state diode lasers and, increasingly, to camera-based sensors that can also read the two-dimensional codes a sweeping beam physically cannot. The barcode itself carries no intelligence; all the decoding logic, and all of the standardization that keeps two products from ever sharing a number, lives in the scanner and in GS1's global prefix registry.
Read next:
- How digital cameras capture color
- How NFC payments work securely
- How noise-canceling headphones work
FAQ
Q: How does a laser scanner read a barcode?
A laser beam sweeps across the barcode via a rotating or oscillating mirror, dozens to hundreds of times per second. Black bars absorb light while white spaces reflect it, and a photodiode converts that fluctuating reflectance into a voltage signal whose timing, measured through pulse-width decoding, reveals each bar and space's width and reconstructs the encoded digits.
Q: What is a UPC check digit and why does it matter?
The check digit is the twelfth and final digit of a UPC-A code, calculated from a fixed weighted formula applied to the other eleven digits. If a scanned code fails that checksum, the scanner rejects the read entirely, which is why damaged or smudged barcodes usually fail to scan at all rather than scanning as a different, wrong product.
Q: Can a barcode be scanned in any direction?
Yes. UPC-A uses one set of ten digit patterns on the left half of the code and their structural inverse on the right half, so the scanner can determine from the pattern itself whether it's reading left-to-right or right-to-left and decode the correct sequence regardless of swipe direction.
Q: Why can't laser scanners read QR codes?
A laser scanner captures only a single one-dimensional line across the code per sweep. QR codes encode data across a full two-dimensional grid, so reading one requires capturing the entire pattern as an image, which is why QR codes need CCD or CMOS camera-based scanners rather than a sweeping laser beam.
Q: Who invented the barcode and when was it first patented?
Norman Joseph Woodland and Bernard Silver, both graduate students at the Drexel Institute of Technology, filed the original barcode patent in 1949; it was granted as U.S. Patent 2,612,994 on October 7, 1952. Commercial retail scanning didn't begin until 1974, once laser and electronics technology caught up to the concept.
Q: When was the first barcode scanned commercially?
On June 26, 1974, cashier Sharon Buchanan scanned a 10-pack of Wrigley's Juicy Fruit chewing gum at a Marsh Supermarket in Troy, Ohio, marking the first commercial UPC scan; the item is preserved today in the Smithsonian's National Museum of American History collection (Smithsonian Magazine).
Q: What organization governs global barcode standards?
GS1, an international nonprofit standards body, issues the company prefixes embedded in every UPC and EAN barcode and maintains the technical specifications for those symbologies as well as Code 128 (GS1-128) and GS1's QR code implementation, ensuring no two legitimately registered product codes collide worldwide.
Q: How does a supermarket checkout scanner read a barcode from any angle?
Built-in checkout scanners use a rotating holographic disc with multiple angled facets that split one laser beam into a dense crisscrossing pattern of scan lines running at different orientations and depths of focus simultaneously, rather than the single sweep a handheld scanner produces (USPTO patent 6,085,980). The decoder only needs one of those many lines to cross the barcode cleanly and return a checksum-valid result, which is why dragging a product past the window in almost any orientation still registers instantly.
Q: Why do some barcodes fail to scan on foil or shiny packaging?
Laser scanning depends on light scattering diffusely off the barcode surface back toward the photodiode. Foil, shrink-wrap, and glossy laminate can reflect the beam specularly instead, bouncing it away from the sensor or producing glare that swamps the real signal, a physical limitation rather than a software issue. Camera-based imaging scanners, which can computationally correct for glare and low contrast, tend to handle these surfaces more reliably.
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles



The Barcode: How Stripes on a Package Changed Global Commerce
From Woodland's 1948 beach sketch to the first Wrigley gum scan in 1974, discover how the barcode rewired retail, logistics, and supply chains worldwide.
Best Free E-Signature Tools in 2026 (No Signer Account)
Best free e-signature tools in 2026 where signers need no account: eSignSimple, Zoho Sign, SignWell, Dropbox Sign, DocuSign and Adobe compared on limits and audit trails.
Best Free Online Tools in 2026: How to Pick Them Safely
A hub for our 17 free-tool guides, from PDFs and e-signatures to AI photo apps and prayer times, plus a checklist for privacy, file handling, free tiers, and accessibility.
Best Free PDF Tools With No Watermark in 2026
Best free PDF tools with no watermark in 2026: pdfdots, PDF24, PDFgear, Stirling-PDF, Sejda and iLovePDF compared on limits, file privacy, and price.