Skip to content

How does a QR code scanner actually work?

It is now part of the basic equipment of many smartphones – the QR scanner. But how does it actually work? atechbook explains.

It looks like an incorrectly tuned channel on the TV. We all know the white noise by the name QR code. The square code is now emblazoned on many products, serves as a simple form of address forwarding and also helps Deutsche Bahn to check whether the online ticket is valid. The QR code is a further development of the bar code we have known since the 1970s, which we all know from the supermarket. But how exactly can a scanner read the QR code?

First of all, QR stands for Quick Response. And that’s exactly what you get when you scan the code with a smartphone. With the iPhone, you can do this directly via the camera app. With an Android smartphone, you need a simple QR scanner app.

To understand what happens when you scan the QR code, let’s take a look at the code itself and how it is composed. Because even if the code looks to us like a wildly jumbled collection of white and black areas, every code consists of a basic framework that a QR scanner follows.

This is how a QR code is structured

A QR code consists of seven elements that make the code readable to the scanner in the first place.

Position markings

Position marker at the QR-Code
Position markings in the QR code Photo: atechbook

These must be present for the scanner to recognize the QR code at all.

Alignment marker

Alignment marker at the QR Code
Alignment marker for the QR code Photo: atechbook

The alignment marker helps the scanner to read the QR code even if the surface is uneven. It gives the scanner orientation. The more extensive the encoded information, the more alignment marks the QR code contains.

Synchronization lines / clock cells

Syncronization lines at the QR-Code
Synchronization lines in the QR code Photo: atechbook

These only serve to tell the QR code scanner how large the actual data grid is, i.e. the area containing the relevant information.

Version fields

Version fields in the QR code
Version fields in the QR code Photo: atechbook

As the name suggests, this is how the scanner recognizes the version of the QR code. There are now over 40 different versions.

Format fields

Format fields in QR code
Format fields of the QR code
Photo: atechbook

The format fields contain information about the error tolerance.

Data field / useful & error correction data

Data field in QR code
Data field for QR code
Photo: atechbook

This area contains the encoded information. By the way: A QR code can even still be read when up to 30 percent of the data field has become unreadable, for example because of dirt.

Edge zone

Margin zone at the QR Code
Edge zone of the QR code
Photo: atechbook

The edge zone is essential for the QR code scanner to distinguish the code from the rest of the environment. The edge zone is a kind of picture frame for the scanner.

Static & dynamic

There are static and dynamic QR codes. The difference is simple: a dynamic QR code is editable, so it can be changed later. This allows different information to be encoded via a single QR code.

Why is a QR scanner needed?

The scanner is the interface between the analog and digital worlds. Basically, the QR code scanner works like a barcode scanner. The white and black areas represent an image. The scanner converts the image into readable text, it decodes the image. The whole thing happens in a flash and the desired web page appears on the display.