How a QR code stores and shares information when scanned

By , September 23, 2026

Every time you pay for coffee at a local cafe using an M-Pesa Till number, scan a menu at a restaurant, or join a public Wi-Fi network, you interact with a Quick Response (QR) code.

To the naked eye, it looks like a random cluster of tiny black and white squares. In reality, it is an organised grid designed to store complex data and deliver it to your smartphone screen in a fraction of a second.

The hidden anatomy of the square pattern

At first glance, a QR code seems chaotic, but every square has a specific purpose. The three large squares located at the top-left, top-right, and bottom-left corners are known as finder patterns.

They tell your smartphone camera exactly where the code begins and ends, allowing the lens to detect the grid even if you hold your phone sideways or at an angle.

Smaller squares near the bottom-right serve as alignment patterns, correcting any distortion caused by curved surfaces or poor lighting.

Between these markers sits the actual data grid, made up of individual units called modules.

A study published in the peer-reviewed journal Sensors notes that a QR code is “a square image comprising a grid of black and white square blocks called modules” where data is encoded alongside mathematical formulas to provide “an error-correction capability”.

Each black module represents a binary one, while each white module represents a binary zero.

Combined in rows and columns, these binary values translate into website addresses, phone numbers, or payment tokens.

How your camera translates the pixels

When you align your phone camera over the code, the camera software takes a quick digital snapshot and converts the image into high-contrast black and white.

A QR code menu in a restaurant.

Once the software locates the three finder patterns, it calculates the grid size and orientation. It then reads the binary modules row by row, converting the series of ones and zeros into readable text, such as a URL or a Ksh500 payment request.

What makes QR codes exceptionally reliable in everyday settings is their built-in Reed-Solomon error correction algorithm.

This mathematical system allows the code to remain fully scannable even if up to 30 per cent of the pattern is scratched, dirty, or partially covered.

That is why a creased paper flyer or a slightly smudged sticker at a petrol station still opens the correct link instantly without error.

More Articles