How QR codes work: the technical explanation for non-engineers

Plenty of people wonder how the magic works behind those black squares. In this article I’ll walk you through the technology step by step, but in plain English, so you can explain it to anyone, even if you never wrote a line of code.

1. The building blocks - modules, patterns, and timing

A QR code is essentially a two-dimensional matrix of tiny squares, called modules. Think of it like a chess board, but instead of black and white squares arranged in a pattern, each square holds a bit of data. The entire code is a square shape, usually ranging from 21 modules on a side for the smallest version up to 177 modules for the biggest version.

At the very edges you’ll notice three distinct squares called positioning patterns. These are the big 7x7 blocks that help a scanner orient the code, even if it’s rotated or slightly skewed. Nearby you’ll also find alignment patterns (small squares) and timing patterns (a line of alternating modules) that give the scanner a reference for the spacing between modules. All of these help the scanner correctly map the tiny modules to binary data.

2. Encoding your message into modules

To create a QR code you first decide what you want to store: a URL, plain text, contact details, or something else. The data is then converted into binary, which is a series of 0s and 1s. That binary string is split into groups of 8 bits, called bytes. Each byte is then assigned a pattern of modules on the grid following a strict rule set.

For example, if you want to encode “Hello”, the ASCII code for H is 72 (01001000 in binary). Each of those bits becomes a single module. The QR standard defines where each bit lands on the grid so that different data produce different shapes. Because of this systematic approach, any scanner that follows the standard will reliably interpret the same modules back into the original text.

3. Error correction - making QR codes robust

No print is perfect - ink bleeds, surfaces get dirty, or a card is bent. To cope, QR codes use error correction based on the Reed-Solomon algorithm. You choose a level (L, M, Q, H). Level L can recover about 7% of lost data, M about 15%, Q 25%, and H a generous 30%. The trade-off is that higher error correction reduces the amount of data you can store.

Suppose you generate a QR code that links to a 200-character URL. If you select level M, the code will still be readable even if 15% of the modules are obscured. That’s why a QR printed on a rough surface or partially covered by a sticker often still works. The embedded error-correction code tells the scanner how to reconstruct the missing modules.

4. How a scanner reads the code

The scanner’s job is to transform a photograph of the code into data. First, it detects the positioning patterns to determine the orientation and scale. Once the grid is mapped, the scanner reads each module, translating black to 1 and white to 0. It then groups the bits into bytes, applies the error-correction decoding, and finally produces the original string or URL.

Modern smartphone cameras can do this in a fraction of a second. They use built-in image processing to sharpen the photo, reduce glare, and correct perspective distortions. That’s why you can scan a QR code that’s been printed on a curved surface or photographed at an angle and still get the right result.

5. Practical step-by-step: creating a QR code for your business

1️⃣ Choose what to store - a URL to your product page, a Wi-Fi password, or a vCard contact. 2️⃣ Know the error-correction level. Level M is a safe middle ground for most printed flyers, and it is the level our generator uses. 3️⃣ Use a free QR generator - I recommend our how to create QR code free guide to choose the right size. 4️⃣ Test the code on a phone before printing. Use the built-in scanner or an app from the App Store or Google Play. 5️⃣ Print on a matte finish to avoid glare. 6️⃣ Place the code in a visible spot - not hidden under a logo or watermark. 7️⃣ Monitor usage - QR code analytics free gives you a quick dashboard of scans, devices, and location.

If you need a more advanced setup, like a URL you can change over time, you can make a URL or PDF code dynamic here for free - the printed code stays the same while you edit where it points.

6. Common pitfalls and how to avoid them

• Too small - If the code is less than 25 millimetres on a side, most phones will struggle. Keep it large enough to scan comfortably. • Bad contrast - The background must be light and the modules dark. Avoid printing on patterns or uneven surfaces. • Overcrowding - Don’t cram too many codes onto a single page; each needs its own breathing space to avoid mis-reads. • Missing alignment - If you shift the code too far from the edges, the positioning patterns might be cut off. The standard calls for a quiet zone of about four modules of clear space on each side.

7. When QR codes become part of a larger workflow

In many marketing campaigns, QR codes act as a bridge between offline and online. A coffee shop might place a QR code on a table that leads to a feedback survey. The code’s data is a simple URL that redirects to a Google Form. You can use our how to update QR code without reprinting guide to change the target URL without re-producing the printed asset - but again that requires a dynamic system, not a static code.

For event organizers, QR codes can be used for check-in. A QR code on each ticket encodes the attendee’s ID. The scanner reads the ID, verifies it against your database, and records attendance. If you’re planning an event, our QR code generator events free guide walks through the options.

FAQ

What is the minimum size for a QR code to be scanned correctly?
At least 25 millimetres on the shortest side is recommended for a typical code scanned at close range. Larger sizes improve reliability, especially outdoors.
Can I update a QR code after it has been printed?
Static QR codes cannot be changed without re-printing. Dynamic QR codes use a short link that can be edited, and this site lets you create dynamic URL and PDF codes for free so you can change the destination without re-printing.
What does a QR code actually store?
A QR code stores binary data encoded in a matrix of black and white squares. The data can be text, a URL, contact information, or any string that fits the chosen error-correcting level.
How does error correction work in QR codes?
QR codes have four levels of error correction (L, M, Q, H). Each level allows the code to be read even if a portion is damaged, at the cost of reduced storage capacity. For most uses, level M is a good balance.
George Smith
WRITTEN BY
George Smith
Founder, Klickify Agency
[email protected]LinkedIn
George builds free web tools that respect user privacy. Founder of Klickify Agency and creator of TrulyFreeQR.com — dynamic QR codes that never expire, no subscription required.