Technology August 29, 2026

How Do QR Codes Work?

A 6-minute read

The unassuming grid of black and white squares you scan with your phone hides an elegant system of redundant data, error correction, and decades of Japanese engineering.

In 1994, a Toyota supplier engineer named Masahiro Hara was trying to speed up inventory tracking on car parts. The one-dimensional barcodes used at the time could only hold about 20 characters, forcing workers to scan them multiple times per item. Hara’s team at Denso Wave built something different: a square grid that could hold hundreds of times more data, readable at any angle, and resilient to damage. They called it the QR code. Thirty years later, your phone scans one roughly every three seconds.

The short answer

A QR code is a two-dimensional barcode that stores data as a grid of black and white modules. Three distinctive square patterns in the corners tell the scanner where the code is and how it is oriented. Between and around those squares, the actual data sits encoded with Reed-Solomon error correction, a mathematical technique that lets the code survive damage to up to 30% of its surface.

The full picture

The anatomy of a QR code

Flip a QR code upside down and you will still scan it. That is no accident. The design is packed with structural features that make it reliable in real-world conditions.

The three most recognizable features are the finder patterns: the large square outlines in three of the four corners. Each finder pattern is a 7-by-7 module square with a black border and a black center, separated by a white ring. The scanner uses these three squares to calculate the code’s position and rotation. Even if you hold your phone at an angle, the software triangulates the code’s location from those three anchors.

The fourth corner holds the timing pattern: an alternating row and column of single modules that help the scanner determine the size of each module and calibrate its reading grid.

Larger QR codes (Versions 2 and up, covering grids from 25 by 25 modules upward) also contain alignment patterns: smaller square markers that help the scanner correct for lens distortion when the code is physically curved or viewed at a steep angle.

Surrounding all of this is the quiet zone: a border of white modules at least four modules wide. This gives the scanner clean edges to work with and prevents adjacent codes from bleeding into each other.

How data is encoded

Between the structural markers sits the actual payload. QR codes do not store data the way you might expect, as a simple list of letters and numbers. Instead, the data goes through several transformation steps.

First, the content is classified by character mode: numeric only (digits 0-9), alphanumeric (digits plus capital letters and a handful of symbols), byte mode (any character), or kanji mode. Each mode has an optimized encoding scheme that packs more information into the same number of modules.

The encoded data is then split into blocks and combined with error correction codewords using Reed-Solomon algebra. This is where the redundancy lives. Reed-Solomon codes were originally developed for deep-space communications because they can reconstruct missing or corrupted data from the remaining valid symbols. Applied to QR codes, this means a code scanned through a smudged label, partially covered by a fingerprint, or printed on a rough surface can still be fully decoded.

QR codes offer four error correction levels: L (Low, 7% recovery), M (Medium, 15%), Q (Quartile, 25%), and H (High, 30%). Higher error correction means more of the code can be damaged, but it also means fewer data modules are available for actual content. A Version 2 QR code at Level H holds significantly less data than the same code at Level L. This is why logos and designs overlaid on QR codes use the H level to protect the remaining readable area.

What you can actually store

A single QR code holds more than most people realize. The maximum capacity depends on the version (grid size) and error correction level. The largest standard version, Version 40, can store up to 4,296 alphanumeric characters at Level L, or roughly 2,000 bytes in byte mode. That is enough for a short email, a web address, contact information (vCard), or payment instructions.

This capacity also explains why QR codes took off in contactless payments. A payment link or account token fits comfortably within the limits, and the error correction means the code survives being printed on receipts, displayed on screens, or scanned under poor lighting.

The scanning process

When your phone camera sees a QR code, the process is faster than you might think. The image processor first identifies the three finder patterns regardless of how the code is rotated or tilted. It then samples the timing patterns to establish the module grid, and finally reads the data modules in a zigzag path from the corner.

The raw bits go through error correction decoding, which reconstructs any corrupted data from the Reed-Solomon redundancy. Once the data blocks are verified, the character mode indicator tells the decoder how to interpret the bit sequence, and the final string is passed to the application.

Why they became ubiquitous after 2020

QR codes existed for nearly three decades before the pandemic, used mostly in manufacturing, logistics, and Japan. The COVID-19 pandemic removed the friction of asking a stranger to hand you something. Restaurant menus went digital, boarding passes moved to phone screens, and payment apps normalized the gesture of pointing your camera at a square. By 2022, 85% of Americans had scanned a QR code, up from under 30% in 2019. The format was invented by Denso Wave, a Toyota subsidiary, which holds the patent and released the specification royalty-free.

The post-pandemic result is a world where QR codes sit on product labels, park benches, rental bikes, and museum exhibits. They are one of the most successful legacy formats in technology, a 1994 Japanese invention that the world eventually could not live without.

Why it matters

QR codes matter because they are the bridge between the physical and digital worlds without requiring specialized hardware. A printed QR code costs essentially nothing and lasts years. It can direct someone to a website, a payment screen, a menu, or a feedback form with nothing more than a phone they already own. For businesses, that is a distribution channel with near-zero marginal cost.

For individuals, understanding how QR codes work explains why they sometimes fail to scan and what makes them secure or insecure. A QR code printed on glossy paper can reflect light in ways that confuse the scanner. A QR code on a screen can be harder to scan if the brightness is too low. And a QR code taped over a legitimate one on a parking meter can redirect your payment to the wrong account. The technology itself is not inherently safe or unsafe, but awareness of how it works helps you use it wisely.

Common misconceptions

“A QR code is just a fancy barcode.”

Barcodes (1D codes) store data in the widths of vertical stripes, read by a laser sweeping across them. QR codes (2D codes) store data in both directions across a grid, read by a camera sensor. The difference in data capacity is roughly 100x: a standard UPC barcode holds about 20 characters, while a small QR code holds hundreds.

“You need a special QR code scanning app.”

Modern smartphone cameras on iOS and Android have QR code scanning built into the default camera app. Third-party scanner apps add features like saving scan history or generating codes, but reading one requires nothing extra in 2026.

“QR codes are read by the color difference between black and white modules.”

Technically correct but incomplete. The scanner reads luminance (light reflected), not color per se. That is why a QR code printed in dark blue on white paper still works, and why a QR code displayed on an OLED screen (where blacks are true off-pixels) scans more reliably than on an LCD screen (where blacks still emit some light).

Key terms

Module: The smallest unit of a QR code, a single black or white square. A QR code is a grid of these modules.

Finder pattern: One of three square markers in the corners of a QR code, used to locate and orient the code. Each is a 7-by-7 module structure with a distinctive black border, black center, and white ring.

Alignment pattern: A smaller square marker found in larger QR codes that helps the scanner correct for perspective distortion when the code is curved or tilted.

Quiet zone: The white border surrounding a QR code, at least four modules wide, which prevents adjacent codes or graphics from interfering with scanning.

Reed-Solomon error correction: A mathematical system that adds redundant data to a message so that errors in reading can be detected and corrected. QR codes use this to remain readable even when portions are damaged or obscured.

Character mode: The encoding format used for the data in a QR code, such as numeric, alphanumeric, byte, or kanji. Each mode packs data differently to maximize capacity.

Version: The size classification of a QR code, ranging from Version 1 (21 by 21 modules) to Version 40 (177 by 177 modules). Larger versions can hold more data.