Key takeaways
- Every barcode scanner does the same three things: it illuminates the code, captures the pattern of light and dark and decodes that pattern into data.
- Laser scanners sweep a beam across a 1D barcode and measure reflected light. They are fast and long-range but cannot read 2D codes.
- Imagers and phone cameras take a picture of the code, so they can read 1D and 2D codes (QR, Data Matrix) in any orientation, including from screens.
- Decoding software finds the code in the image, measures its bars or modules, checks it against its symbology rules and outputs the data.
- Most scan failures come from print quality, damage, glare, low light or the wrong scanner type, not from the barcode itself.
What Happens When You Scan a Barcode
When you scan a barcode, a scanner lights the code, captures how much light each part reflects and software converts that pattern into the characters the code holds. The whole sequence usually takes a fraction of a second.
A barcode works because dark and light areas reflect light differently. Dark bars absorb light; light spaces reflect it. The scanner turns that contrast into an electrical signal or a digital image and the decoder reads the widths of bars and spaces (for 1D codes) or the arrangement of square modules (for 2D codes).
There are three main ways to capture that pattern: a laser beam, a linear image sensor or an area image sensor (a camera). Each suits different jobs.
How Laser Barcode Scanners Work
A laser scanner shines a thin laser beam onto a moving mirror, which sweeps the beam back and forth across the barcode as a red line. A photodiode measures the light reflected back as the beam crosses each bar and space.
The result is a waveform: high where light reflects off spaces, low where bars absorb it. The decoder measures the timing of each rise and fall to work out the relative widths of the bars, then reads the code.
- Strengths: very fast, long reading range (some models read from several metres away), forgiving on wide 1D labels.
- Limits: reads 1D barcodes only, needs the beam to cross the whole code roughly horizontally and cannot read codes on most phone screens.
How Linear Imagers Work
A linear imager uses a single row of light sensors (often called a CCD scanner) instead of a laser. An LED lights the barcode and the sensor row captures one slice of it, like a one-line photograph.
Linear imagers read 1D barcodes and unlike lasers, can often read codes on screens. They have no moving mirror, which makes them durable. Like lasers, they still need to be lined up across the code and cannot read 2D codes.
How 2D Area Imagers and Camera Scanners Work
A 2D area imager takes a full two-dimensional picture of the code with a camera sensor, then software finds and reads the code inside that image. Phone and tablet cameras work the same way, using a scanning app or SDK to do the decoding.
Because the scanner sees the whole image, it can:
- Read 1D and 2D codes, including QR codes, Data Matrix and PDF417.
- Read codes in any orientation (omnidirectional), so the user doesn’t need to line up a beam.
- Read codes on screens and with the right lighting, codes marked directly onto metal or plastic.
- Read several codes in one capture, which matters for labels that carry more than one barcode.
Image-based scanning is also where AI-powered decoding fits. Because the software works on a full image, it can correct for blur, perspective, glare and damage before decoding.
Laser vs Imager vs Phone Camera: Comparison
| Laser scanner | Linear imager | 2D area imager | Phone / tablet camera |
| How it captures | Sweeping laser beam + photodiode | One row of sensors | Full image sensor | Full image sensor + app or SDK |
| 1D barcodes | Yes | Yes | Yes | Yes |
| 2D codes (QR, Data Matrix) | No | No | Yes | Yes |
| Reads from screens | Usually no | Often | Yes | Yes |
| Orientation | Must cross the code | Must cross the code | Any | Any |
| Typical range | Short to long | Short | Short to medium | Short to medium |
| Best for | Retail checkout, long-range warehouse picking | Simple, durable 1D scanning | Mixed 1D/2D, DPM, healthcare, manufacturing | Field work, mobile apps, BYOD workflows |
How Decoding Works
Decoding is the software step that turns a captured pattern into data. For image-based scanners it runs in five stages:
- Locate. Find where the code sits in the image and which way it’s rotated.
- Correct. Adjust for perspective, curvature, blur and uneven lighting.
- Sample. Measure the bars and spaces (1D) or the grid of light and dark modules (2D).
- Decode. Translate the measurements using the rules of that symbology, such as UPC, Code 128 or QR.
- Verify. Check the result with a check digit (most 1D codes) or error correction (2D codes), and reject it if it doesn’t add up.
The verification step is why a barcode either scans correctly or doesn’t scan at all. A wrong read is far rarer than a no-read.
Code types differ in how much they hold. A 1D barcode typically carries a short identifier, such as a 12-digit UPC. A QR code can hold up to 4,296 alphanumeric characters, and a Data Matrix code up to 2,335, while staying readable even when part of the code is damaged, thanks to built-in error correction. See our guide to types of barcodes for the main symbologies.
How to Scan a Barcode With a Phone
To scan a barcode with a phone, open a camera or scanning app, point it at the code, and hold steady until the app reads it. A few habits make scans faster and more reliable:
- Fill most of the frame with the code but leave a small margin around it.
- Hold the phone parallel to the label to avoid perspective distortion.
- Avoid glare by tilting slightly away from bright lights or shiny surfaces.
- Add light in dim areas, using the phone’s torch if needed.
- Hold still for a moment so the camera can focus.
Most phone camera apps read QR codes directly. Reading 1D product barcodes, or scanning many codes at work, usually needs an app with a built-in barcode scanner.
Why Barcodes Fail to Scan
When a barcode won’t scan, the cause is usually one of these:
| Cause | What happens | Fix |
| Poor print quality | Bars bleed or fade, so widths can't be measured | Better print settings or label stock |
| Physical damage | Scratches, tears or dirt break the pattern | Image-based scanning with damage recovery; reprint |
| Low contrast | Faded print or coloured backgrounds | Rescan in better light; fix the label design |
| Glare | Shiny labels or film reflect light into the sensor | Change the angle; diffuse lighting |
| Low light | The sensor can't capture enough detail | Add light; use a scanner tuned for low light |
| Wrong scanner type | A laser can't read a QR or Data Matrix code | Use an imager or camera-based scanner |
| Missing quiet zone | Printing too close to the edge confuses the decoder | Leave a clear margin around the code |
For tough labels, see how AI handles scanning damaged and low-light barcodes.
Barcode Scanning in Your Own App
Scanflow Capture is an AI-powered data capture SDK that adds barcode, label and text scanning to your own app. It runs on iOS, Android, React Native, Flutter, Xamarin, .NET MAUI and Web JS, and works offline, so scanning continues in warehouses, yards and field locations with no signal.
Because it decodes from the full camera image, it is built for the codes that defeat ordinary scanners: damaged, faded, rotated and low-light barcodes, and labels with several codes and text fields together.