How Barcode Scanners Work: Laser, Imager and Phone Camera
How do barcode scanners work, and which kinds can read which barcodes?
Short answer
Every scanner lights the code, measures the light that bounces back, and decodes the pattern. Laser scanners and linear imagers sample one line across the code, so they read 1D barcodes only; 2D area imagers and phone cameras capture a whole image and read both 1D and 2D codes. Many USB scanners then type the result into your software like a keyboard.
On this page
Scanner listings are full of terms like 1D, 2D, linear imager, area imager and HID. Those words tell you more about what a scanner can do than the brand name does, and they decide whether it will read the barcodes you plan to print.
Here's what each type of scanner actually does, why some can't read QR codes, and how the scanned data gets into your software.
What every scanner does
According to Cognex, every barcode scanner has three essential parts: a light source, a sensor that detects how much light reflects back from the code, and a decoder that turns that pattern into data your software can use. Dark bars absorb light and light spaces reflect it, so the sensor sees a pattern of low and high readings.
The decoder measures the relative widths in that pattern, matches them against the rules of each enabled barcode type, checks any check digit, and sends the result as text.
Most dedicated scanners use red light. Zebra's LS2208 handheld uses a 650 nm laser, and GS1 says checkout scanners, laser or imager, typically work in the 630 to 680 nm red range. That's why red bars are invisible to them.
Laser scanners and linear imagers: one line at a time
Laser scanners
A laser scanner uses moving mirrors or prisms to sweep a laser beam across the code. A sensor measures the reflection and turns it into electrical pulses, which the decoder converts into data (Cognex). A handheld laser projects a single line. The scanners built into many checkout counters use mirrors to project a crisscross pattern, so a 1D barcode reads at any angle.
Using a laser well takes a little technique. Zebra's LS2208 guide says the line must cross every bar and space, and warns that aiming straight on bounces light back into the scanner and can prevent a read, so tilt it slightly. Cognex notes that a laser typically fails on a damaged or incomplete code, and Zebra notes that lasers can't read barcodes on phone screens.
Linear imagers
A linear imager replaces the moving laser with a single row of light sensors, effectively a one-line camera. Cognex describes these charge-coupled device (CCD) scanners as cheaper competitors to lasers when they arrived in the 1990s. They have no moving parts, but they still see only one line through the code.
Area imagers: a picture of the whole code
A 2D area imager works like a digital camera. Zebra describes it as taking a photo of the barcode and decoding it, which lets it read both 1D and 2D codes. Because it captures the whole symbol, it doesn't need to be lined up with the bars and can often work around damaged or incomplete codes that would stop a laser, according to Cognex.
Area imagers also read codes from phone screens, which matters if you accept mobile coupons, tickets or loyalty codes. The GS1 General Specifications state that 2D imaging scanners can read every barcode in the GS1 system, including GS1 DataMatrix and QR codes.
| Scanner type | How it reads | 1D barcodes | QR and other 2D codes | Phone screens |
|---|---|---|---|---|
| Laser | Sweeps a red laser line across the code | Yes | No | No |
| Linear imager | Captures one line with a row of sensors | Yes | No | Check the spec sheet |
| 2D area imager | Captures an image of the whole code | Yes, at any angle | Yes | Yes |
| Phone camera | Captures an image; an app decodes it | Depends on the app | Depends on the app | Possible |
Phone cameras
A phone is an area imager with a general-purpose camera, and the decoding happens in software. What it reads depends on the app or library. Google's ML Kit, for example, decodes Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A and UPC-E, plus Aztec, Data Matrix, PDF417 and QR codes, entirely on the device.
Phones see barcodes differently from checkout scanners. The GS1 2D Barcode Colour & Quality Guide explains that phones use white light rather than narrow red light, and that their larger camera aperture makes them less sensitive to low contrast. A red QR code can decode on a phone and fail at a register. Phones are handy for quick checks and light use, but a phone read doesn't prove a barcode will work on a red-light scanner.
Why a 1D-only scanner can't read a QR code
A 1D barcode stores everything in the widths of bars along one direction. Any straight line that crosses all the bars carries the whole message, so one sweep of a laser or one row of sensors is enough.
A QR code stores data in both directions, in a grid of square modules. A single line through it captures one thin slice of that grid, a small fraction of the data with no way to rebuild the rest. Firmware can't fix this, because the hardware never sees the other rows. GS1 states it directly: linear imagers, like laser scanners, can't scan 2D barcodes, and only 2D imagers and camera-based systems can.
If you plan to use QR codes on packaging, signs or shipping labels, buy a 2D area imager. For how the two kinds of code compare, see QR code vs barcode.
How the scan reaches your software
Keyboard wedge (USB HID keyboard)
In keyboard wedge mode, the scanner appears to the computer as a keyboard, and the decoded data is typed wherever your cursor is. Microsoft notes this lets you scan into programs that know nothing about scanners, such as Notepad. Zebra's LS2208, for example, uses USB HID keyboard mode by default.
This is the easiest setup for spreadsheets, web forms and many small-business programs, and it needs no special driver. The trade-offs come from pretending to be a keyboard. Your program can't tell a scan from typing, the scanner's keyboard layout has to match the computer's, and you choose whether an Enter or Tab is added after each scan. Zebra's guide lists settings for country keyboard layouts, Caps Lock handling and suffixes.
HID POS, serial and SDK modes
For software that controls the scanner directly, scanners offer other modes. Windows includes a driver for USB scanners set to HID POS Scanner mode, and Microsoft says that for more control from your application you need a non-keyboard-wedge mode. Bluetooth scanners must use the SPP-SSI mode to work with the Windows barcode scanner APIs. Zebra's LS2208 manual, for instance, lists modes such as Simple COM Port Emulation and Zebra's own SNAPI in addition to keyboard mode.
Use whatever mode your software's instructions specify. You usually switch modes by scanning a programming barcode printed in the scanner's manual.
Bottom line
- If you need QR or other 2D codes, or codes on phone screens, buy a 2D area imager.
- If you only read printed 1D barcodes such as UPC and Code 128, a laser scanner or linear imager will do.
- Use a phone for quick checks and light work, not as proof that a barcode will scan at a register.
- Start with keyboard wedge mode unless your software asks for HID POS or a vendor SDK.
If a scanner won't read a particular label, the barcode not scanning checklist walks through the likely causes in order.
Sources
- GS1: GS1 General Specifications Standard (Release 26.0)
- GS1: GS1 2D Barcode Colour & Quality Guide (Release 1.0, Feb 2025)
- Cognex: Evolution of Barcode Scanners
- Cognex: Barcode Marking Methods and Types of Readers
- Zebra Technologies: What Is a 2D Barcode?
- Zebra Technologies: LS2208 Product Reference Guide
- Microsoft Learn: Configure a barcode scanner
- Google for Developers: Barcode scanning (ML Kit)