How does a QR code work?
A QR code works by turning data into a grid of dark and light modules that a camera can recognise, align, and decode. The large locator shapes help your phone find the code and correct its angle. The smaller modules carry the encoded content, such as text or a web address. Extra checking information is also built into the pattern, so the reader can often recover the message even when part of the code is dirty, scratched, blurred, or missing.
What the pattern is made of
A QR code is not just a random block pattern. It has several jobs laid out in one grid.
The most visible parts are the finder patterns, the large square targets near the corners. They tell the scanner where the code is and how it is turned. Because of them, you do not need to hold the code perfectly upright.
Other fixed patterns help the reader measure the grid. Timing marks give the software a rhythm for where each module begins and ends. The blank margin around the outside, called the quiet zone, keeps the code visually separate from nearby text, images, packaging, or screen edges.
The remaining modules hold the useful information. Some represent the message itself. Others describe how the message should be read, such as the type of data stored. Some are there for checking and repair.
How your phone reads it
When you point your phone at a QR code, the camera captures an image and the scanning software looks for the finder patterns. Once it has found them, it works out the code’s position, tilt, scale, and perspective. This matters because a code on a poster, receipt, screen, or curved packet rarely appears as a perfect square to the camera.
The software then maps the photographed image back to the code’s grid. It samples each module and decides whether that part of the grid should be treated as dark or light. Those decisions become a stream of digital data.
The reader then follows the QR code format to interpret that stream. It separates layout information from stored content, checks the data, corrects what it can, and passes the result to the phone. Depending on what the code contains, the phone may show text, prepare a web address, add contact details, or offer another action.
Why damaged QR codes can still scan
QR codes can survive some damage because they carry more than the bare message. When the code is created, the encoder adds error-correction information. This is extra mathematical material that lets the reader detect and repair parts of the pattern that were read wrongly or not read at all.
That is why a QR code can still work when a label is scuffed, a screen has glare, or a printed code has a mark across part of it. The scanner does not need every module to be perfect. It needs enough of the structure and enough reliable data to rebuild the message.
There is a limit. If the finder patterns are obscured, the quiet zone is crowded, the image is too blurred, or too much of the data area is gone, the reader cannot confidently reconstruct the code. A clear print, strong contrast, and a little empty space around the code all make scanning easier.
What makes the design reliable
A QR code is reliable because its design separates recognition from meaning. The finder and timing patterns help the camera understand the grid. The data modules hold the message. The correction information helps repair reading errors.
That division of labour is the main reason QR codes feel simple in use. Your phone is not just taking a picture of a pattern. It is finding a structured grid, straightening it, reading it, checking it, and then turning it back into information you can use.