Guides Everyday tools
QR Codes Explained: How They Work and How to Make Ones That Scan
How QR codes store data, which settings matter for reliable scanning and how to avoid QR code scams.
QR codes are everywhere: on restaurant tables, product packaging, payment counters, wedding cards, exam admit cards and business cards. A phone camera reads them in a second, which makes them one of the simplest ways to move information from the physical world to a screen. Yet many printed codes scan badly or not at all, because of poor size, contrast or placement.
This guide explains how QR codes work, what the settings in a QR code generator mean, how to design codes that scan reliably and how to protect yourself from QR code scams.
A short history
QR stands for Quick Response. The code was invented in 1994 by Denso Wave, a Japanese company in the Toyota group, to track car parts in factories. Unlike a traditional barcode, which stores data in one direction, a QR code stores it in two dimensions, so it holds far more information in a small square. Smartphone cameras made QR codes mainstream, and they became even more common during the pandemic, when contactless menus and payments spread.
How a QR code is built
A QR code is a grid of small squares called modules. Several parts have fixed jobs:
- Finder patterns: the three large squares in the corners, which let a scanner locate the code and work out its angle.
- Alignment patterns: smaller squares that help correct distortion when the code is curved or photographed at an angle.
- Timing patterns: alternating lines of modules that help the scanner work out the grid size.
- Format information: a few modules that record the error correction level and other settings.
- Data and error correction modules: everything else, holding your content plus extra recovery information.
QR codes come in 40 sizes called versions. Version 1 is 21 × 21 modules; each version adds 4 modules per side, up to version 40 at 177 × 177. The more data you store, the higher the version and the smaller each module becomes at a given print size.
How much a QR code can hold
Capacity depends on the version, the kind of data and the error correction level. At the lowest error correction level:
| Data type | Version 1 | Version 40 |
|---|---|---|
| Numbers only | 41 digits | 7,089 digits |
| Letters and numbers (uppercase) | 25 characters | 4,296 characters |
| Any bytes, such as a web address | 17 bytes | 2,953 bytes |
In practice, keep content short. A short web address makes a simpler code with larger modules that scans more easily than a long address full of tracking parameters.
Error correction: the code that survives damage
QR codes include redundant data, so they can be read even when part of the code is dirty, scratched or covered. There are four levels:
| Level | Approximate damage it can recover from |
|---|---|
| L (low) | about 7% |
| M (medium) | about 15% |
| Q (quartile) | about 25% |
| H (high) | about 30% |
Higher levels make the code denser. Use M for most purposes, and Q or H for codes that will be printed on surfaces likely to get damaged, or when placing a small logo in the centre. The QR Code Generator lets you choose the level.
Size, distance and contrast
- Print size: a common rule of thumb is a minimum of about 2 × 2 cm for codes scanned close up, such as on business cards. Larger is safer, especially for longer content.
- Scanning distance: a widely used guideline is that the code's width should be at least one tenth of the scanning distance. A poster read from 2 metres away needs a code of about 20 cm.
- Quiet zone: leave a clear margin, ideally four modules wide, around the code. Text or images pressed against the edges confuse scanners.
- Contrast: dark modules on a light background work best. Inverted codes and low-contrast colour combinations, such as light grey on white, fail on many phones.
- Surface: glossy laminate causes glare; curved surfaces such as bottles distort the grid. Test the final printed item, not just the screen version.
Static and dynamic codes
A static code stores the content directly. It works forever, needs no account and cannot be changed after printing. A dynamic code stores a short link to a service that redirects to your content; it can be edited and tracked, but it stops working if the service closes or the subscription lapses. For anything printed in large numbers or meant to last, a static code pointing to a web address you control is the most robust choice, because you can update the page itself whenever you need to.
Useful kinds of QR code
- Web addresses: the most common use, for menus, product pages and forms.
- Wi-Fi details: guests scan to join your network without typing a password; the Wi-Fi QR Code Generator creates these.
- Contact cards: a vCard code adds your name, phone number and email to a contact list.
- Plain text: reference numbers, short instructions or serial numbers.
- Payments: banks and wallets use QR codes to carry merchant account details.
For product packaging and retail shelves, traditional barcodes are still standard; the Barcode Generator creates those.
QR code scams
Because people cannot read a QR code with their eyes, criminals use them to hide malicious links. Common tricks include stickers placed over genuine payment or parking codes, fake codes on flyers that lead to look-alike login pages, and codes in messages claiming a prize or a delivery problem.
- Check the address before opening it. Most phone cameras show the link first. The QR Code Scanner on this site displays the decoded content without opening it.
- Look for stickers. At payment counters and parking machines, check whether the code has been stuck over another one.
- Confirm the payee. Before paying through a QR code, make sure the name shown in your banking app matches the shop or person you intend to pay.
- Never enter passwords or OTPs on a page reached through a QR code you did not expect.
Designing codes for print
A QR code on its own does not tell people why they should scan it. Place a short instruction beside it, such as "Scan for the menu" or "Scan to see the location", and print a short web address underneath as a fallback for anyone whose camera struggles. For wedding and event cards, a code linking to a map location saves guests from searching for the venue. For shop counters, a matte laminate avoids glare under bright lights. Avoid placing codes across folds, in corners where thumbs cover them or on dark, busy backgrounds. Before printing hundreds of copies, print one, stick it where it will be used and scan it with two or three different phones, including an older one.
Common mistakes
- Printing too small or with no margin. Test from the real scanning distance.
- Using long, messy links. Shorter content means a simpler, more reliable code.
- Low contrast designs. Keep codes dark on light.
- Not testing on several phones. Older phones and different camera apps vary.
- Linking to a page that might disappear. Make sure the destination will last as long as the printed code.
Privacy
The QR generator and scanner on this site work in your browser. The content you encode and the codes you scan are processed on your device and are not sent to this website.