What is a QR code, and how does it work?
A QR code is a two-dimensional barcode that stores text, usually a link, as a grid of black and white squares. Any phone camera can read it without an extra app.
6 min read · Updated
The name is short for Quick Response code. It was invented in 1994 by Denso Wave, a Toyota subsidiary, to track car parts faster than a striped barcode could, which is where the “quick” comes from. A regular barcode stores data in one direction, so it runs out of room after a dozen or so characters. A QR code stores data in two directions at once, so it can hold a full URL, a contact card or a Wi-Fi password.
What a QR code is made of
Every QR code is a grid of squares called modules. Some of them are fixed landmarks that carry no data:
- Finder patterns: the three big squares in the corners. A scanner looks for these first, because they tell it where the code is and which way up it is. This is why a QR code still scans upside down.
- Alignment patterns: smaller squares that help the scanner correct for a curved or tilted surface, such as a bottle or a badge held at an angle.
- Timing patterns: the dotted lines between the finders. They mark out the module grid, so the scanner knows how big one square is.
- Format and version information: a small strip that records which error correction level was used and how big the grid is.
The rest of the grid is your data plus its error correction. When you change the eye shapes and colours in the generator, you are restyling those landmarks. A scanner can still read them as long as the contrast and proportions stay intact.
Version: why more text makes a denser code
QR codes come in 40 versions. Version 1 is a 21×21 grid; each step adds four modules per side, up to 177×177 at version 40. The encoder picks the smallest version your data fits into. A short link therefore produces a coarse, forgiving code, and a long one produces a fine-grained code that needs a better camera and a bigger print.
If you remember one thing from this page, make it this: shorter content means bigger squares, and bigger squares scan from further away and cope better with poor printing. If a code looks like dense noise, shorten the link before changing anything else.
Error correction: why a damaged code still works
QR codes use Reed–Solomon error correction, the same family of maths that lets a scratched CD keep playing. Redundant data is built into the grid, so a scanner can reconstruct modules it cannot read. You choose how much space to give to that redundancy:
| Level | Recovers up to | Use it when |
|---|---|---|
| L — Low | ~7% | On-screen only, long content, clean conditions |
| M — Medium | ~15% | The sensible default for most printing |
| Q — Quartile | ~25% | Small logo, or print that may get scuffed |
| H — High | ~30% | Large logo, artistic codes, packaging |
Swipe the table to see all columns.
Redundancy takes up room: a higher level makes the code denser for the same content. The extra tolerance is also the reason adding a logo works at all, since the scanner rebuilds the modules the logo covers.
The quiet zone is part of the code
A QR code needs an empty margin of at least four modules on every side. Without it, a scanner cannot tell where the grid ends, and the code fails even if the pattern itself is intact. Cropping tight to the black edge is one of the most common reasons a printed code stops working.
Static vs dynamic codes
A static code contains your actual content. It works indefinitely and offline, with no service in between, but it cannot be changed after printing. A dynamic code contains a short redirect URL owned by a service. You can edit the destination later and count scans, but the code stops working if that service shuts down or starts charging.
Every code made here is static by design. If you need to change the destination later, point the code at a page you control, such as a short link on your own domain. The redirect then belongs to you and not to a vendor.
What a QR code can hold
A QR code only holds text. What makes a phone offer to join a network or save a contact is the format of that text, which follows conventions scanners recognise: a WIFI: string for networks, BEGIN:VCARD for contacts, geo: for coordinates. The generator writes these strings for you. For details, see the guides on Wi-Fi codes and contact cards.
Is “QR Code” a trademark?
Yes. The term is a registered trademark of Denso Wave. The specification itself is open (ISO/IEC 18004), and Denso Wave has never charged for using it, which is a large part of why the format is everywhere. You can generate, print and sell products carrying QR codes freely. What you should not do is suggest that your product comes from Denso Wave.