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 scannerLinear imager2D area imagerPhone / tablet camera
How it capturesSweeping laser beam + photodiodeOne row of sensorsFull image sensorFull image sensor + app or SDK
1D barcodesYesYesYesYes
2D codes (QR, Data Matrix)NoNoYesYes
Reads from screensUsually noOftenYesYes
OrientationMust cross the codeMust cross the codeAnyAny
Typical rangeShort to longShortShort to mediumShort to medium
Best forRetail checkout, long-range warehouse pickingSimple, durable 1D scanningMixed 1D/2D, DPM, healthcare, manufacturingField 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:

  1. Locate. Find where the code sits in the image and which way it’s rotated.
  2. Correct. Adjust for perspective, curvature, blur and uneven lighting.
  3. Sample. Measure the bars and spaces (1D) or the grid of light and dark modules (2D).
  4. Decode. Translate the measurements using the rules of that symbology, such as UPC, Code 128 or QR.
  5. 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:

  1. Fill most of the frame with the code but leave a small margin around it.
  2. Hold the phone parallel to the label to avoid perspective distortion.
  3. Avoid glare by tilting slightly away from bright lights or shiny surfaces.
  4. Add light in dim areas, using the phone’s torch if needed.
  5. 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:

CauseWhat happensFix
Poor print qualityBars bleed or fade, so widths can't be measuredBetter print settings or label stock
Physical damageScratches, tears or dirt break the patternImage-based scanning with damage recovery; reprint
Low contrastFaded print or coloured backgroundsRescan in better light; fix the label design
GlareShiny labels or film reflect light into the sensorChange the angle; diffuse lighting
Low lightThe sensor can't capture enough detailAdd light; use a scanner tuned for low light
Wrong scanner typeA laser can't read a QR or Data Matrix codeUse an imager or camera-based scanner
Missing quiet zonePrinting too close to the edge confuses the decoderLeave 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.

FAQs:

 It lights the barcode, captures the pattern of light and dark, and decodes the widths of bars and spaces (or the grid of 2D modules) into data, using the rules of that barcode type.

 A laser scanner sweeps a beam across a 1D barcode and measures reflected light. An imager takes a picture of the code, so it reads 1D and 2D codes in any orientation, including from screens.

 No. QR codes and other 2D codes need an image-based scanner, such as a 2D imager or a phone camera.

Open a camera or scanning app, point it at the code so it fills most of the frame, hold steady and avoid glare. Most phone cameras read QR codes directly; 1D product barcodes usually need a scanning app.

 Common causes are poor print quality, damage, low contrast, glare, low light, a missing margin around the code, or using a laser scanner on a 2D code.

A check digit is a number calculated from the other digits in a barcode. The scanner recalculates it and rejects the read if it doesn't match, which prevents wrong reads.

 For many mobile and field workflows, yes, especially with a scanning SDK built for difficult codes. Dedicated scanners still suit very high-volume or long-range scanning.

Related Stories

ourstories-line

AI-Enabled Barcode Scanning vs Traditional Scanning

Over 10 billion barcodes are scanned every single day, twice as many as a decade ago. Behind every o...

10 Mins read

May 7, 2026

Read More

Types of Barcodes: Choosing the Right Barcode

Barcodes are integral for tracking items and providing identification in today's world. Barcodes...

8 Mins read

Feb 5, 2026

Read More