How QR Codes Work: Modules, Encoding, and Scanning Explained
Learn how QR codes work — finder patterns, data encoding, camera decoding, and error correction levels L/M/Q/H — explained clearly for non-engineers.
You have seen QR codes on menus, posters, product packaging, and event badges. They look like dense grids of black and white squares, yet a smartphone camera can turn that pattern into a website link, a Wi‑Fi password, or a payment request in under a second. Understanding how that happens helps you design codes that scan reliably, choose the right settings when you generate them, and troubleshoot when something goes wrong.
This guide is part of our General collection on QR code fundamentals. If you are brand new to the topic, start with what a QR code is for a high-level overview. Here we go deeper into the mechanics — still in plain language, without assuming an engineering background.
A grid of modules: the building blocks
At the most basic level, a QR code is a two-dimensional barcode: information stored in a square grid rather than a single horizontal line like a traditional UPC barcode at a grocery checkout. For capacity, scan angles, and when UPC/EAN or Data Matrix fit better than QR, see QR codes vs barcodes.
Each tiny square in the grid is called a module. A module is either dark (usually black) or light (usually white). The pattern of dark and light modules is not random decoration — it is a carefully structured message that both humans and machines can read, though humans typically rely on software to decode it.
Think of modules as binary switches: dark might represent “1” and light might represent “0,” or the reverse depending on how the image is processed. Thousands of these on/off values together encode the actual content — a URL, text, contact details, and so on.
The overall grid has a fixed version (size). Version 1 is a 21×21 module square; each step up adds four modules per side. Larger versions hold more data but also need more physical space on a label or screen to remain scannable. When you use a dynamic QR code generator such as Izoukhai’s tool, the generator handles version selection and layout automatically so you do not have to calculate module counts yourself.
Finder patterns: three anchors in the corners
If you look closely at almost any QR code, you will notice three identical large square patterns in three of the four corners (top-left, top-right, and bottom-left). These are finder patterns (also called position detection patterns).
Each finder pattern is a nested square: a 7×7 dark outer border, a 5×5 light ring inside that, and a 3×3 dark center. This distinctive shape is easy for software to spot even when the code is photographed at an angle, partially shadowed, or scaled to different sizes.
Your phone’s camera does not “read” the QR code left to right like text. Instead, the decoding app searches the image for these three finder patterns first. Once it locates them, it knows:
- Where the QR code is in the frame
- How large it is relative to the image
- How it is rotated or skewed (perspective distortion from holding the phone at an angle)
The fourth corner has no finder pattern; that space is used for other structural elements. Without finder patterns, a camera would struggle to distinguish a QR code from random black-and-white texture in the background.
Alignment patterns, timing lines, and the quiet zone
Larger QR codes (version 2 and above) add smaller alignment patterns — additional nested squares placed at predictable positions inside the grid. They help the decoder correct distortion when the code is printed on curved surfaces (bottles, cups) or photographed from a sharp angle. Smaller codes often omit alignment patterns because the three finder patterns alone provide enough reference.
Timing patterns are alternating dark and light modules running horizontally and vertically between the finder patterns. They tell the decoder the exact module size and help it map every cell in the grid, row by row and column by column.
Near the finder patterns you will also find format information — a small encoded region that stores metadata about how the QR code was generated, including which error correction level was used (covered below).
Finally, a scannable QR code needs a quiet zone: an empty margin of light modules around the entire symbol. Standards typically require at least four modules of white space on all sides. If text, graphics, or a busy background intrude into this margin, scanners may fail to detect the edges of the code. This is one reason QR code design and scan reliability matter as much as the encoded data itself.
Encoding data: turning your message into a pattern
Before modules are laid out on the grid, your content goes through encoding — a process that converts human-readable information into bits (zeros and ones) according to international QR standards (ISO/IEC 18004).
Encoding modes
QR codes support several character modes, chosen automatically or manually depending on the generator:
| Mode | Best for | Concept |
|---|---|---|
| Numeric | Digits only (0–9) | Most compact for phone numbers, IDs |
| Alphanumeric | Numbers plus uppercase letters and a few symbols | URLs without lowercase, some product codes |
| Byte | Full text, URLs with mixed case, binary data | Most common for web links and general text |
| Kanji | Japanese characters | Specialized use |
A URL like https://example.com/page is typically encoded in byte mode. The more efficiently your content fits a mode, the fewer modules you need — which can mean a smaller printed code or room for more redundancy.
Capacity and version
Each version has a maximum data capacity that depends on the encoding mode and error correction level. A short link might fit in a compact version 1 or 2 code; a long URL or a vCard contact might require version 5 or higher, producing a denser pattern.
Generators also add mode indicators and length fields so the decoder knows how to interpret the bit stream. Special structured append features exist for splitting very large payloads across multiple codes, though most business use cases fit in a single symbol.
If you compare static vs dynamic QR codes, the physical QR image for a dynamic code often stays short — it encodes only a redirect URL on the provider’s domain — while the final destination can be changed later in a dashboard. That is a business workflow choice, not a change to how modules and finder patterns work.
What your camera does when you scan
Scanning feels instant, but several conceptual steps happen between pointing your lens at the code and seeing a link open.
1. Image capture
The camera captures a frame — a grid of pixels, each with color and brightness. This raw image may include blur, glare, shadows, and background clutter.
2. Binarization
Software converts the image to high-contrast black and white, estimating where module boundaries fall. Poor lighting or reflective laminate can make this step unreliable — one common reason scans fail.
3. Finder pattern search
The decoder scans for the three finder patterns described earlier. If it cannot find all three with confidence, it does not proceed (or may keep searching in live preview mode).
4. Perspective correction
Using the known geometry of finder patterns, the software unwarps the image — mathematically flattening a skewed or trapezoidal view into a square grid aligned with the module layout.
5. Grid sampling and format read
The decoder walks the grid using timing patterns, reads format information, and samples each module as dark or light. It reconstructs the raw bit sequence.
6. Error correction and decoding
The bit stream includes redundant data (see next section). The algorithm corrects small errors — smudged modules, print dots missing — then extracts the payload: URL, text, Wi‑Fi credentials, etc.
7. Action
The app opens the URL, shows the text, or triggers the appropriate system action. For business QR code use cases, this last step might be analytics on the provider’s side if the code is dynamic.
None of this requires an internet connection for reading a static code’s payload — decoding is local. Dynamic redirects happen only after the encoded URL is opened.
Error correction levels: L, M, Q, and H
QR codes include Reed–Solomon error correction — extra bits that let the symbol remain readable even when part of it is damaged, dirty, or obscured. When you generate a code, you (or your tool) choose a level:
| Level | Approx. recovery | Typical use |
|---|---|---|
| L (Low) | ~7% of codewords | Clean indoor prints, maximum data capacity |
| M (Medium) | ~15% | Default for many generators; good balance |
| Q (Quartile) | ~25% | Outdoor signage, moderate wear |
| H (High) | ~30% | Logos inside the code, harsh environments |
Higher correction means more redundancy and often a denser or larger code for the same amount of data, because space is sacrificed for recoverability. Lower correction packs more data into a smaller symbol but tolerates less damage.
Choosing a level in practice
- Use M for most marketing materials, business cards, and screen display.
- Consider Q or H for warehouse labels, construction sites, or stickers exposed to scratching.
- Choose H if you plan to place a logo over the center of the code (a common branding technique). The logo covers modules that error correction must replace mathematically. See branding QR codes with logos and colors for safe logo size and customization tradeoffs.
- Use L only when you need maximum capacity in a tiny area and the print conditions are controlled.
Some myths about QR codes suggest that “more black” always means better scanning. In reality, contrast and structural integrity matter more than error level alone — a high-correction code printed too small or without a quiet zone can still fail.
Why scans fail: conceptual causes
When a QR code does not scan, the problem usually falls into one of these categories:
Insufficient contrast. Modules must be clearly darker or lighter than the background. Light gray on white, or yellow on cream, breaks binarization.
Missing or cropped quiet zone. Edge-to-edge artwork that touches the finder patterns confuses boundary detection.
Physical size too small. Each module must span enough pixels in the camera image. A code meant for a billboard will not work on a pen barrel.
Blur and motion. Moving the phone or camera too quickly, or autofocus lag, smears module edges.
Glare and reflections. Glossy lamination creates white hotspots that look like light modules.
Damage and wear. Scratches, folds, and dirt destroy modules; only so much can be corrected — even at level H.
Over-customization. Extreme rounding of modules, inverted colors (light modules on dark backgrounds can work but need care), or heavy decorative distortion can break standards compliance.
Wrong or expired content. The code may scan perfectly yet lead to a 404 page or disabled redirect — a workflow issue, not an optical one. Dynamic codes depend on the provider remaining online; reputable platforms keep codes working after you cancel, which is worth verifying when you choose a generator.
Extreme curvature. On tight cylindrical surfaces, alignment patterns help, but very small codes on curved objects remain challenging.
Understanding these failure modes connects directly to best practices for QR code design — size, contrast, placement, and testing QR codes before you print.
How this knowledge helps your next project
You do not need to hand-draw finder patterns or calculate Reed–Solomon polynomials. Modern tools abstract that complexity. Still, knowing the moving parts helps you:
- Ask better questions when a campaign code fails in the field
- Choose static or dynamic encoding deliberately
- Set error correction appropriately for logos and environment
- Brief designers on quiet zones and minimum size
When you are ready to create codes for production, Izoukhai offers one of the most affordable unlimited dynamic QR generators available: $3.99 per month or $39.99 per year (roughly 20% savings annually), with unlimited codes and unlimited scans on a single plan. You can customize colors, shapes, frames, and logos; export SVG for crisp print; use smart redirects by device or location; and view real-time analytics on scans, devices, and locations. If you change the destination URL, you update it in the dashboard — no reprint. Codes keep working after you cancel, so you are not locked into perpetual billing to preserve live campaigns.
Compared with many enterprise tools charging around $200 per year, that pricing can save $160 or more annually while covering typical business use cases from menus to event check-in.
Conclusion
A QR code is a standardized grid of modules anchored by three finder patterns, filled with encoded bits and protected by selectable error correction. Your phone finds those patterns, corrects perspective, reads the bit stream, and recovers from small damage before handing off a URL or other payload.
The technology is robust by design — that is why QR codes survived years of skepticism and became ubiquitous. Robust does not mean foolproof: contrast, size, quiet zone, and print quality still determine success in the real world.
Explore more in our General section: compare static and dynamic QR codes, review common myths, weigh QR codes vs barcodes, and apply design best practices when you publish. When you need a dependable dynamic generator with analytics and fair pricing, try Izoukhai’s QR code tool — unlimited codes, full customization, and destinations you can change anytime without starting over.