How QR codes work
By Prabhneet Singh Narula, founder of RelyQr · Updated
Short answer
A QR code stores information in a grid of black and white squares called modules. Three large squares in the corners tell a phone's camera where the code is and which way up it is; the rest holds the data and extra error-correction data, so the code still scans when part of it is damaged or covered by a logo.
Who invented the QR code
The QR code (Quick Response code) was invented in 1994 by a team led by Masahiro Hara at Denso Wave, a Toyota group company, to track car parts faster than linear barcodes allowed. It's an international standard, ISO/IEC 18004, and free for anyone to use: Denso Wave holds the patent but chose not to enforce it for the standard code.
The parts of a QR code
- Finder patterns: the three large squares in the corners, which let a camera find the code from any angle.
- Timing patterns: rows of alternating modules between the finder patterns, which set the grid size.
- Alignment patterns: smaller squares, from version 2 up, which correct for curved or angled codes.
- Format information: the error-correction level and the mask pattern used to keep the grid easy to read.
- Data and error-correction modules: everything else, holding the content and the extra data that repairs damage.
- The quiet zone: a clear margin four modules wide on every side, without which cameras can't tell where the code starts.
Versions, size and how much fits
QR codes come in 40 versions. Version 1 is 21 × 21 modules and each version adds four modules per side, up to 177 × 177 for version 40. The more you store, the higher the version and the denser the pattern, which is why short content prints well small.
| Content | Version 1 (21 × 21), low correction | Version 40 (177 × 177), low correction |
|---|---|---|
| Digits only | 41 | 7,089 |
| Capital letters, digits and a few symbols | 25 | 4,296 |
| Any text (bytes) | 17 | 2,953 |
| Kanji | 10 | 1,817 |
Error correction
Every QR code carries extra error-correction data at one of four levels: L recovers about 7% of the code, M 15%, Q 25% and H 30%. Higher levels survive more damage, or a logo in the middle, at the cost of a denser pattern. Adding a logo works because of it.
Static and dynamic QR codes
A static QR code holds its content, like a web address or Wi-Fi details, in the pattern itself. A dynamic QR code holds a short link that forwards to the content, so the destination can change after printing and every scan can be counted. Read static vs dynamic QR codes for when to use each.
All guides
Static and dynamic codes
- Static vs dynamic QR codesStatic QR codes store content in the pattern and never change. Dynamic QR codes store a short link you can edit and track. A side-by-side comparison, and when to use each.Read the guide
- Can you change a QR code after printing?You can change a QR code after printing if it's dynamic: update the destination and every printed copy follows. Static codes can't be changed. Here's how to do it.Read the guide
- How to track QR code scansTrack QR code scans with a dynamic QR code: see how many people scanned, when, roughly where and on which device, plus UTM tags for Google Analytics.Read the guide
- What is a dynamic QR code?A dynamic QR code holds a short link you can redirect after printing, and counts every scan. How it works, what you can change, what it costs and what to check.Read the guide
Expiry and fixes
- Do QR codes expire?A QR code itself never expires. Static codes work forever; dynamic codes depend on the service behind them. Here's what makes a code stop, and how to avoid it.Read the guide
- QR code stopped working? Here's why, and how to fix itWhy a QR code that used to work stops: a deactivated dynamic code, a moved website, damaged print or changed content. How to tell which it is, and fix it.Read the guide
- QR code not scanning? 10 causes and fixesThe 10 reasons QR codes fail to scan, from low contrast and small print to glare and dense patterns, with a fix for each and a test to run before printing.Read the guide
Design and print
- QR code size for printingThe minimum QR code size is 2 × 2 cm (0.8 in). For longer distances use the 10:1 rule. A size chart for business cards, flyers, table tents, posters and windows.Read the guide
- How to add a logo to a QR codeAdd a logo to a QR code without breaking it: use high error correction, keep the logo under a quarter of the code and off the corner squares, then test-scan.Read the guide
- QR code best practices15 rules for QR codes people actually scan: size, contrast, margins, logos, calls to action, placement, mobile pages, testing and tracking.Read the guide
Making codes and staying safe
- How to make a QR codeMake a QR code in under a minute: choose what it does, enter your details, style it with a logo and download it for print or screens. Free, no sign-up.Read the guide
- Are QR codes safe?QR codes are safe to scan; the risk is where a fake one leads. How QR code scams (quishing) work, the warnings from the FBI and FTC, and how to check a code.Read the guide
- How to scan a QR codeScan a QR code with your phone's camera on iPhone or Android, from a photo or screenshot, or on a computer. Plus what to do when a code won't scan.Read the guide
Make a QR code that lasts forever
Free static codes with your logo and no watermark, and dynamic codes that keep working on every plan.
QR Code is a registered trademark of DENSO WAVE INCORPORATED.