What is a QR Code? History, Types & How It Works
QR codes are everywhere — on restaurant menus, product packaging, event tickets, and advertisements. But what exactly are they, and how do those small black-and-white squares store information?
A Brief History of QR Codes
QR code stands for Quick Response code. It was invented in 1994 by Masahiro Hara at Denso Wave, a Japanese subsidiary of Toyota. The original purpose was to track automotive parts during manufacturing — conventional barcodes were too limited in the amount of data they could store.
Unlike traditional barcodes that store data in one dimension (horizontal lines), QR codes store data in two dimensions — both horizontally and vertically. This allows them to hold significantly more information: up to 7,089 numeric characters or 4,296 alphanumeric characters.
Denso Wave released the QR code specification publicly and chose not to enforce their patent rights, which led to widespread adoption. Today, QR codes are standardized under ISO/IEC 18004.
How QR Codes Store Data
A QR code is made up of black and white modules (squares) arranged in a grid. Here's how the different parts work:
Finder Patterns
The three large squares in the corners (top-left, top-right, bottom-left) are finder patterns. They help scanners quickly locate and orient the QR code, even if it's tilted or partly obscured. This is why QR codes can be scanned from any angle.
Alignment Pattern
Larger QR codes (version 2 and above) include smaller alignment patterns to help correct for distortion — such as when the code is printed on a curved surface.
Timing Patterns
The alternating black-and-white modules between the finder patterns form timing patterns, which help the scanner determine the grid size.
Data and Error Correction
The remaining area contains the actual encoded data plus error correction codewords. The data is encoded using one of four modes:
- Numeric mode — digits 0-9 (most efficient, ~3.3 bits per character)
- Alphanumeric mode — digits, uppercase letters, and some symbols (~5.5 bits per character)
- Byte mode — any 8-bit data, including UTF-8 text (8 bits per character)
- Kanji mode — Japanese characters (~13 bits per character)
See It for Yourself
The quickest way to understand versions, modes and error correction is to watch them change. The generator below reports what the encoder chose for whatever you type.
Try it: see how content changes a QR code
Edit the text or the error correction level. Everything is generated in your browser.
Three things worth trying:
- Switch between the uppercase and lowercase URL samples. The uppercase one fits the 45-character alphanumeric set, so the encoder packs two characters into 11 bits. A single lowercase letter forces byte mode at 8 bits per character, which is why short links printed in capitals can produce a smaller code.
- Load the long tracked link. Every UTM parameter adds modules. That is the real cost of tracking a printed code, and why a shorter link scans more easily from further away.
- Move error correction from M to H. The same content needs a higher version, because more of the symbol is spent on recovery data. That trade is what makes room for a logo.
Once you have a code, the QR code size calculator turns its module grid into a minimum print size for the distance it will be read from.
Error Correction Levels
One of the most remarkable features of QR codes is their built-in error correction using Reed-Solomon error correction. This means QR codes can still be read even if part of the code is damaged, dirty, or obscured.
There are four error correction levels:
| Level | Recovery Capacity | Best For |
|---|---|---|
| L (Low) | ~7% of codewords recoverable | Maximum data capacity |
| M (Medium) | ~15% of codewords recoverable | General use (default) |
| Q (Quartile) | ~25% of codewords recoverable | Industrial, outdoor use |
| H (High) | ~30% of codewords recoverable | Codes with logo overlay |
Level H is often used when a logo or image is placed in the center of the QR code — the error correction compensates for the "damaged" area. Note what these percentages count: they are proportions of the symbol’s codewords, the eight-bit units the data is stored in, not proportions of the picture you may cover. A logo destroys every codeword it touches, so it always costs more than its footprint suggests — see how much of a QR code a logo can really cover.
Types of QR Codes
Static QR Codes
Static QR codes encode data directly. Once created, the encoded content cannot be changed. They're free to generate and don't require an internet connection to scan. Best for: permanent information like WiFi passwords, contact cards, or fixed URLs.
Dynamic QR Codes
Dynamic QR codes encode a short redirect URL instead of the final content. The destination can be changed after the code is printed, and scan analytics (location, time, device) can be tracked. Best for: marketing campaigns, menus that change, or content that needs updating.
Micro QR Codes
Micro QR codes are a compact version that uses only one finder pattern (instead of three), allowing them to be printed in very small spaces. They hold less data but are perfect for electronics or small product labels.
QR Codes vs. Barcodes
| Feature | 1D Barcode | QR Code |
|---|---|---|
| Data capacity | ~20-25 characters | Up to 7,089 characters |
| Data type | Numbers (typically) | Text, URLs, binary data |
| Error correction | Check digit only | Reed-Solomon (7-30%) |
| Scan angle | The scan line must cross all the bars | Any angle (360°) |
| Size | Width depends on data | Fixed square shape |
Common Uses of QR Codes
- Payments — UPI, WeChat Pay, and Alipay all use QR codes for contactless payments
- Restaurant menus — scan to view digital menus, especially popular since 2020
- Event tickets — boarding passes, concert tickets, and conference badges
- Product packaging — link to manuals, warranty registration, or product details
- Business cards — encode contact details as a vCard for one-scan saving
- WiFi sharing — guests scan to connect without typing the password
- Authentication — two-factor authentication apps use QR codes to set up TOTP
How to Scan a QR Code
Most modern smartphones can scan QR codes directly with the built-in camera app. Simply point the camera at the QR code — no need to take a photo — and a notification or link will appear. On a laptop, or when the code is already in a screenshot, see how to scan a QR code on a computer, which includes a scanner that reads codes straight from an image.
For more advanced features like scan history, batch scanning, CSV export, and barcode support, dedicated scanner apps like Scan & Generate provide additional functionality.
Frequently Asked Questions
What does QR stand for?
Quick Response. Denso Wave, a Toyota subsidiary, gave the format that name in 1994 because it was designed to be read far faster than the linear barcodes then used to track car parts along a production line.
How much data can a QR code hold?
At its largest — version 40 with the lowest error correction — up to 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes. Real-world codes are far smaller, because a URL of 30 to 60 characters only needs a version 3 to 6 code, which is easier to print and quicker to scan. Our QR code capacity calculator shows exactly which version any given content needs.
Do QR codes expire?
A static QR code never expires. The data is printed into the pattern itself, so it will keep decoding to the same text for as long as the image survives. A dynamic QR code points at a redirect service instead, and stops working if that service is shut down or the subscription lapses — the difference is covered in our guide to static versus dynamic QR codes.
Can a QR code still be scanned if it is damaged?
Usually, yes. QR codes use Reed–Solomon error correction, and at the highest level roughly 30% of the symbol’s codewords can be restored — enough that a torn corner or a printed-over patch often still reads. Two caveats matter. That figure counts codewords rather than area, and a single damaged module writes off the whole eight-module codeword, so the share lost always runs ahead of the share covered. And the three corner squares, the timing lines and the format information carry no error correction at all, so damage there stops the decode whatever the level. Our guide to QR code logo size works the real limits through.
Can a QR code contain a virus?
Not directly — a QR code is only text. The risk is what that text points at: a link to a fake login page, or to a file download. The danger lives on the page you open, not in the pattern, which is why previewing the link before opening it matters. See our guide to spotting fake QR codes, or paste a scanned link into our QR code link checker.
Are QR codes free to use?
Yes. The QR code specification was published as an open standard — ISO/IEC 18004 — and Denso Wave chose not to enforce its patent rights over it. You can generate and print as many static codes as you like without paying anyone. Paid services sell tracking, editable destinations, and analytics, not the codes themselves.
Why do some QR codes have a logo in the middle?
Because error correction lets the scanner reconstruct the covered modules. The usual advice — keep the logo within the recoverable percentage and use level H — is looser than it sounds, because that percentage counts codewords rather than area and a logo writes off every codeword it clips. For a typical short URL at level H a square logo of about 30% of the code’s width, which is roughly 9% of its area, is a sensible ceiling. The logo size calculator works it out for a specific code.
What is the difference between a QR code and a Data Matrix?
Both are 2D codes, but they look and behave differently. A QR code has three large squares in its corners; a Data Matrix has a solid L-shaped border and a dashed edge opposite it. Data Matrix is more compact at small sizes, which is why it is used on medicine packs and electronic components — see what GS1 DataMatrix is.