Skip to main content
QR Code Basics

QR Code Basics: What They Are and How They Work

7 min read Last updated 2026-11-17

A QR code is a two-dimensional barcode that stores information - most often a link - as a grid of black and white modules. Any modern phone camera can read one natively, which is why QR codes have become the default bridge between printed material and the web.

This guide covers the essentials: how the code is structured, how scanners actually read it, how much data fits inside, and the difference between static and dynamic codes. Once you understand these mechanics, every design, printing and troubleshooting decision becomes easier to reason about.

A short history and why QR codes won

The QR code was invented in 1994 by Masahiro Hara and his team at Denso Wave, a Toyota group company that needed to track car parts faster than one-dimensional barcodes allowed. The name stands for Quick Response, reflecting the design goal of near-instant reading. Where a linear barcode stores a short string of digits in a single dimension, a QR code stores data in two dimensions, so its capacity grows with the area of the grid rather than its length.

Two engineering decisions explain why the format spread everywhere. First, the code was built to be read quickly and to survive damage, using finder patterns for orientation and Reed-Solomon error correction for resilience. Second, Denso Wave declined to enforce its essential patents against standard implementations, so anyone could generate and scan QR codes freely. When both major phone platforms added native scanning to their camera apps in the late 2010s, the format became infrastructure.

The anatomy of a QR code

Every QR code has three large corner squares called finder patterns. They tell the scanner where the code begins and ends and let it correct orientation, so scans work upside down or at an angle. A fourth, smaller alignment pattern appears in larger codes and compensates for bending or distortion when the code is printed on curved or flexible material.

Between the finder patterns sits the data region: the grid of modules that encodes your actual payload. Alternating stripes called timing patterns establish the grid coordinates, and small format blocks record the error correction level and mask pattern in use. A thin quiet zone - a blank margin around the code - separates the modules from their surroundings and is required for reliable scanning.

  • Finder patterns: the three corner squares used for orientation
  • Timing patterns: alternating stripes that establish the grid
  • Alignment pattern: corrects distortion in larger codes
  • Format and version information: records error correction level and grid size
  • Data and error correction codewords: your payload plus redundancy
  • Quiet zone: the mandatory blank margin around the code

Versions, capacity and encoding modes

QR codes come in 40 versions. Version 1 is a 21 by 21 module grid, and each subsequent version adds four modules per side, up to version 40 at 177 by 177. Larger versions hold more data, but the modules shrink for a given printed size, so more data means slower scans and stricter demands on print quality.

Capacity also depends on the encoding mode. Numeric mode packs digits most tightly, alphanumeric mode handles uppercase letters, digits and a few symbols, and byte mode carries UTF-8 text. At version 40 with low error correction, the theoretical maximums are roughly 7,089 numeric digits, 4,296 alphanumeric characters and 2,953 bytes of binary data.

In practice, payloads under a couple of hundred characters are the sweet spot. They produce larger modules, faster scans and better tolerance of imperfect print. The specification also defines eight mask patterns that vary how light and dark regions are distributed, preventing large blank areas and accidental lookalike patterns. The scanner knows which mask was applied because it is recorded in the format information.

Error correction: why damaged codes still scan

QR codes include Reed-Solomon error correction, the same family of algorithms used on CDs and satellite transmissions. Depending on the chosen level - L, M, Q or H - roughly 7%, 15%, 25% or 30% of the codewords can be lost and the payload still decodes. This redundancy is spread across the whole grid, which is why a logo can sit in the center of a well-made QR code and why a scratched corner often scans anyway.

Higher correction levels make the grid denser for the same content, because some modules must carry redundancy instead of data. A practical default is level M for clean digital displays and Q or H when adding a logo or expecting rough handling, such as codes on factory floors, event wristbands or product packaging. The cost of over-protecting is only a slightly denser grid, while the cost of under-protecting is a code that stops scanning in the field.

Static versus dynamic QR codes

A static QR code encodes the final content - the URL, WiFi credentials or contact card - directly into the modules. It never expires, works offline forever and cannot be tracked or edited, because there is nothing between the scan and the content. Anyone can decode it with any scanner, and no third party sees the scan.

A dynamic QR code encodes a short redirect URL owned by a service. The service can repoint the destination and count scans, but the code stops working if that company shuts down or changes its redirect policy. This platform generates static codes only, which keeps them permanent and private.

Key takeaways

  • QR codes store data in two dimensions, so capacity grows with grid area rather than length
  • Three finder patterns let scanners read the code at any orientation, and a quiet zone keeps it separable from its background
  • Version 40 holds about 4,296 alphanumeric characters, but short payloads scan faster and print larger
  • Error correction levels L, M, Q and H tolerate roughly 7%, 15%, 25% and 30% damage
  • Static codes are permanent and private; dynamic codes can be edited and tracked but depend on a third-party redirect

Put it into practice

Frequently asked questions