What Is a QR Code? How They Work and Why They're Everywhere
The history, technology, and anatomy of QR codes explained in plain language.
QR codes are so common now that most people scan them without thinking about how they work. You point your phone camera at a square pattern of black and white modules, and suddenly you're on a website, connected to WiFi, or saving a contact. But there's genuinely clever engineering behind that simple interaction.
A Brief History
QR codes were invented in 1994 by Masahiro Hara at Denso Wave, a subsidiary of Toyota. The original purpose was tracking automotive parts during manufacturing. Traditional barcodes could only hold about 20 characters of data, which wasn't enough for complex part numbers and supply chain information. Hara's team designed a two-dimensional code that could store thousands of characters and be read at high speed from any angle.
The "QR" stands for "Quick Response," reflecting the design goal of instant readability. Denso Wave made a critical business decision: they chose not to enforce their patent rights, allowing anyone to create and use QR codes freely. This open approach is why QR codes became a global standard rather than a proprietary technology locked behind licensing fees.
For years, QR codes were primarily used in industrial and logistics contexts. Their mainstream consumer adoption came in two waves — first in Japan during the mid-2000s when mobile carriers built QR scanning into phone cameras, and then globally during the COVID-19 pandemic when contactless interactions became a health necessity. Restaurants replaced physical menus with QR codes, businesses adopted contactless payments, and health authorities used QR codes for vaccine verification.
How QR Codes Store Data
A QR code is a two-dimensional matrix of dark and light modules (the small squares) arranged in a specific pattern. Unlike a barcode, which encodes data in one direction (horizontally), a QR code encodes data both horizontally and vertically, dramatically increasing its capacity.
The data capacity depends on the type of content being encoded. A QR code can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. In practice, most QR codes hold far less — a typical URL is 50-100 characters, which produces a relatively small, easily scannable code.
The encoding process works in several steps. First, the input data is analyzed and the most efficient encoding mode is selected (numeric, alphanumeric, byte, or Kanji). The data is then converted into a binary bitstream and arranged into data codewords. Error correction codewords are calculated and appended using Reed-Solomon error correction algorithms. Finally, the combined data and error correction codewords are mapped onto the matrix following a specific placement pattern.
Anatomy of a QR Code
Every QR code contains several structural elements that help scanners read it correctly.
Finder patterns are the three large squares in the corners (top-left, top-right, and bottom-left). These tell the scanner where the code is and what orientation it's in. Because there are exactly three finder patterns arranged asymmetrically, the scanner can determine the code's rotation and perspective angle instantly.
Alignment patterns are smaller squares that appear in larger QR codes (version 2 and above). They help the scanner compensate for distortion — if the code is on a curved surface or photographed at an angle, alignment patterns provide reference points to correct the perspective.
Timing patterns are alternating dark and light modules running between the finder patterns. They help the scanner determine the size of individual modules, which is critical for accurate reading.
Format information is encoded near the finder patterns and tells the scanner which error correction level is being used and which data masking pattern was applied.
The data area fills the remaining space with the encoded information, arranged in a specific serpentine pattern that maximizes redundancy and error resilience.
How Phone Cameras Read QR Codes
Modern smartphones use computational photography to read QR codes. The process happens in milliseconds. The camera captures an image, and image processing algorithms locate the finder patterns to identify where the QR code is in the frame. The software then calculates the perspective transformation needed to "flatten" the code into a perfect square, even if it was photographed at an angle. It samples each module position to determine whether it's dark or light, reconstructs the binary data, applies error correction to fix any reading errors, decodes the data according to its encoding mode, and presents the result to the user.
Both iOS (since version 11) and Android (since version 9) have built-in QR code scanning in their default camera apps, eliminating the need for third-party scanner apps that were once required.
QR Codes vs. Barcodes
Traditional one-dimensional barcodes (like UPC codes on grocery products) encode data in varying widths of parallel lines. They're limited to about 20-25 characters and can only be read in one orientation. QR codes offer dramatically more capacity, can be read from any angle, include built-in error correction, and can encode various data types beyond simple numbers. Barcodes still dominate retail point-of-sale because existing infrastructure supports them and the data requirements (product ID numbers) are simple. QR codes dominate everywhere else — marketing, payments, authentication, information sharing, and logistics.
Create your own QR code in seconds — no signup required.
Open QR Forge →