How does a QR code scanner actually work?

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

It looks like a wrong channel on the TV. We all know the white noise under the name QR code. The square code is now emblazoned on many products, serves as a simple form of address transfer and also helps Deutsche Bahn to check whether the online ticket is valid. The QR code is a further development of the bar code that has been known since the 1970s and that 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, this can be done directly via the camera app. With an Android smartphone, you need a simple QR scanner app.

To understand what happens when the QR code is scanned, 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 thrown together collection of white and black areas, each code consists of a basic framework that a QR scanner uses as a guide.

Also read: 7 golden rules of the American FBI for dealing with QR codes

This is how a QR code is structured

A QR code consists of seven elements that make the code readable for the scanner at all.

position markers

Position marker for the QR codePhoto: TECHBOOK

These must be present so that the scanner can even recognize the QR code.

alignment mark

Alignment mark on QR code
Alignment mark on QR code Photo: TECHBOOK

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

Synchronization lines / clock cells

QR code synchronization lines
QR code sync linesPhoto: TECHBOOK

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

version fields

QR code version fields
QR code version fieldsPhoto: TECHBOOK

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

format fields

Format fields for the QR code
Format fields for the QR code
Photo: TECHBOOK

The format fields contain error tolerance information.

Data field / payload & error correction data

QR code data field
QR code data field
Photo: TECHBOOK

This area contains the encrypted information. By the way: A QR code can even be read if up to 30 percent of the data field has become illegible, for example due to dirt.

edge zone

Edge zone at the QR code
Edge zone at the QR code
Photo: TECHBOOK

The edge zone is essential so that the QR code scanner can distinguish the code from the other surroundings. 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, meaning it can be changed later. In this way, different information can be encrypted using a single QR code.

Also read: Easily share WiFi password in Android via QR code

Why is a QR scanner needed?

The scanner is the interface between the analog and digital world. 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 website appears on the display.

ttn-35