How QR Codes Work: Error Correction, Quiet Zones and Sizing
- What a QR code actually encodes
- The anatomy of the pattern
- Finder, timing and alignment patterns
- Versions and density
- Error correction: how damaged codes still scan
- The quiet zone
- Sizing for print and screen
- Common QR code mistakes
- Frequently asked questions
- Do QR codes expire?
- How much data can a QR code hold?
On this page
- What a QR code actually encodes
- The anatomy of the pattern
- Finder, timing and alignment patterns
- Versions and density
- Error correction: how damaged codes still scan
- The quiet zone
- Sizing for print and screen
- Common QR code mistakes
- Frequently asked questions
- Do QR codes expire?
- How much data can a QR code hold?
A QR code looks like it should mean something — a pattern you could learn to read if you stared at it long enough. It doesn't, at least not directly. A QR code is a two-dimensional barcode: a grid of dark and light squares, called modules, that encodes a string of data along with extra information that lets a camera find it, orient it and repair it if part of it is damaged.
Knowing how that works explains most of the practical rules around QR codes — why a logo in the middle doesn't break them, why they need a blank border, and why a code packed with too much data stops scanning reliably from across a room.
What a QR code actually encodes
A QR code is just a data container. It holds a sequence of characters, and it has no idea what those characters mean. The meaning comes from the scanning app, which recognises certain formats and offers an appropriate action.
- Plain text: shown as-is by the scanner.
- A URL, such as https://example.com/menu — the most common use, and the scanner offers to open it.
- WiFi credentials, in a format like WIFI:T:WPA;S:CafeGuest;P:espresso123;; — phones recognise it and offer to join the network.
- A contact card (vCard), beginning BEGIN:VCARD, which the phone offers to save as a new contact.
- Email, SMS and phone links (mailto:, SMSTO:, tel:), which open the relevant app with details pre-filled.
Because the code only stores characters, a "WiFi QR code" isn't a special kind of code — it's an ordinary code containing text in a format phones happen to understand. It also means a printed QR code can't be edited later. So-called dynamic QR codes work around this by encoding a short redirect URL on a service you control; the code never changes, but where the link points can.
The anatomy of the pattern
Not every module carries your data. A good share of the grid is fixed structure that helps the scanner do its job:
Finder, timing and alignment patterns
The three large squares in the corners are finder patterns. They let a camera locate the code and work out its rotation from any angle. Thin alternating lines between them, the timing patterns, tell the scanner how big each module is. Larger codes add smaller alignment squares that help correct for distortion when the code is printed on a curved surface or photographed at an angle.
Versions and density
QR codes come in 40 sizes called versions. Version 1 is a 21 × 21 grid of modules, and each version adds 4 modules per side, up to 177 × 177 at version 40. More data needs more modules, so the generator picks a higher version automatically. At a fixed printed size, a higher version means each module is physically smaller — and smaller modules are harder for a camera to resolve.
Error correction: how damaged codes still scan
QR codes use Reed-Solomon error correction, the same family of techniques used on CDs and in deep-space communication. The generator adds redundant data alongside your content, so the scanner can reconstruct missing or unreadable modules. There are four levels, and you choose one when generating the code:
- L (Low): roughly 7% of the data can be restored.
- M (Medium): roughly 15% — a sensible default for most uses.
- Q (Quartile): roughly 25%.
- H (High): roughly 30%, for codes likely to be damaged, dirty or partly covered.
The trade-off is space. Higher error correction means more redundant data, which means more modules for the same content — either a denser pattern or a larger code. Level H can store noticeably less content than level L at the same version.
This redundancy is exactly how logos end up in the middle of QR codes. The logo destroys the modules underneath it, and error correction rebuilds them. It works — but the logo is spending the same recovery budget that would otherwise cover scratches, glare or a crease in the paper.
Watch out
If you put a logo on a QR code, use level H, keep the logo small and centred, and never cover the three corner finder squares. Then test the printed result with several different phones, including an older one, before you print a thousand of them.
The quiet zone
The QR specification requires a blank margin, called the quiet zone, around the code — at least four modules wide on every side. It's not decoration. Scanners rely on the contrast between the finder patterns and the empty space around them to detect where the code begins. Crop the margin away, or place the code tight against a busy background or another graphic, and many scanners simply fail to find it.
Designers cut the quiet zone more than any other element, usually to make the code fit a tight layout. If space is limited, shrink the whole code slightly and keep its margin, rather than keeping the size and losing the margin.
Sizing for print and screen
The right size depends on how far away the person scanning will be. A widely used rule of thumb is a distance-to-size ratio of about 10:1 — the code's width should be roughly a tenth of the scanning distance. Here's how that plays out:
- Business card or product label, scanned from about 20–25 cm: at least 2–2.5 cm wide, and 2 cm is a common practical minimum for print.
- Flyer or table menu, scanned from about 50 cm: around 5 cm wide.
- Poster on a wall, scanned from 2 metres: around 20 cm wide.
- Banner or window sign read from 5 metres: around 50 cm wide.
- On screen, such as a slide or login page: at least a few hundred pixels across, displayed at full brightness.
These figures assume a short URL and a low-density code. A code with more data has smaller modules and needs extra size to scan from the same distance. For print, export at a high resolution or as a vector (SVG) so the module edges stay crisp rather than blurring.
Tip
Shorten what you encode before you think about sizing. A 25-character URL produces a far simpler pattern than a 200-character tracking link full of query parameters, and a simpler pattern scans faster, from further away, at a smaller printed size.
Common QR code mistakes
- Too small for the scanning distance — a code that works on your desk may be unreadable on a poster across a room.
- Low contrast — pale grey on white, or dark on dark blue, gives the camera too little to work with. Dark modules on a light background is the safest choice; inverted codes (light on dark) still fail on some scanners.
- No quiet zone — the margin cropped off, or the code placed over a photo or pattern.
- Encoding far more data than needed — long URLs, full vCards with every field, or paragraphs of text all push the code to a higher version and a denser pattern.
- Pointing to a page that later disappears — a printed code outlives most campaign URLs, so link to something you'll keep online.
- Never testing the final print — screen previews hide problems that paper, lighting and glossy finishes reveal.
Frequently asked questions
Do QR codes expire?
A standard (static) QR code never expires — the data is stored in the pattern itself and will scan for as long as the image exists. What can stop working is the destination: if the URL goes offline, or if a dynamic QR service that hosts your redirect link is cancelled, the code will scan but lead nowhere.
How much data can a QR code hold?
At the largest version and lowest error correction, up to 7,089 numeric digits, 4,296 alphanumeric characters or 2,953 bytes. In practice you should stay far below that — a code near its maximum capacity is extremely dense and hard to scan with a phone camera.
A QR code is a simple idea — characters in, grid of squares out — surrounded by a few rules that decide whether it works in the real world. Keep the data short, pick an error correction level that matches the conditions, leave the quiet zone alone, size it for the distance, and test the printed version before anyone else has to.
Ready to put this into practice?
Generate a QR Code Free