What is inside a QR code
A QR code is a grid of black and white squares called modules. The three big squares in the corners tell the camera where the code is and which way up it is; the smaller squares inside larger codes help it correct for a curved or tilted surface. The rest of the grid holds the content, encoded as bits, plus a block of error-correction data that lets the reader rebuild parts it cannot see.
How many modules a code has depends on how much it holds. The smallest version is 21 by 21 modules and holds a short web address; the largest is 177 by 177 and holds about 3,000 characters of ordinary text. More content means more modules, and more modules means each module is smaller when the code is printed at a given size, which means the camera needs to be closer or the print larger. The first rule of a reliable code, then, is to put less in it.
Rule one: keep the content short
A web address like https://toolboxhere.com/qr-code-generator/ makes a 29 by 29 code. The same address with a tracking string after it (?utm_source=newsletter&utm_medium=email&utm_campaign=october) needs 41 by 41, and at the same print size each module is 30% smaller. Strip tracking parameters you do not need. If the address is long because of the site, consider linking to a shorter page that leads on to it.
Short content also matters for the other things people put in codes:
- Wi-Fi. The code holds
WIFI:T:WPA;S:network name;P:password;;and a phone joins the network when it scans. Nothing else is needed. - A contact card (vCard). Name, phone and email are enough; a full card with address, company and notes makes a dense code that only scans well when large.
- Plain text. Arabic, Urdu and emoji work as long as the generator encodes them as UTF-8. Older generators use Latin-1 and turn Arabic into question marks; ours encodes UTF-8, and the preview reads the code back so you can see the text as a phone will.
- Phone, SMS and email links.
tel:,sms:andmailto:addresses open the right app on scanning.
Rule two: print it big enough for the distance
A phone camera needs each module to cover a few pixels of its sensor. The guidance that has held up in practice is the ten-to-one rule: the code should be at least one tenth as wide as the distance it is scanned from. A code on a table card read from 25 cm can be 2.5 cm wide. A poster read from 3 metres needs a 30 cm code. A sign across a street needs a code a metre across, which is why those usually fail.
For codes scanned by hand, from a card, a receipt or a screen, 2 by 2 cm is a sensible minimum for a short address at error-correction level M, and 3 cm is safer if the code is dense or the print is on rough paper. On screen, 200 pixels across is enough for a phone held up to a laptop.
| Where the code goes | Scanning distance | Minimum width |
|---|---|---|
| Business card, receipt, menu | 20 to 30 cm | 2 to 3 cm |
| A4 flyer, product packaging | 50 cm | 5 cm |
| Shop window, poster at a bus stop | 1 to 3 m | 10 to 30 cm |
| Banner, vehicle, billboard | 5 to 10 m | 50 cm to 1 m |
Whatever the size, print at a resolution that keeps the module edges sharp. Export as SVG for anything that goes to a printer, because it scales without blur; export PNG at 1,000 pixels or more if the printer or the document cannot take SVG.
Rule three: leave the quiet zone alone
The QR standard requires a blank margin of four modules on every side of the code, called the quiet zone. Readers use the contrast between the margin and the finder squares to find the code; a code butted up against a border, a photo or text often will not scan even though nothing in it is damaged. Our generator always draws the quiet zone, and a frame with a caption sits outside it. If you place the code in your own design, keep at least four modules, and ideally more, of the background colour around it.
The same goes for contrast. Dark modules on a light background scan reliably; a light code on a dark background scans on some phones and not others, because many readers only look for dark-on-light. Keep the modules dark and the background light, and avoid a background colour close to the module colour.
Rule four: match the error correction to the abuse
Every QR code carries extra data that lets a reader reconstruct modules it cannot see, whether they are hidden by a logo, scuffed, or lost in a reflection. There are four levels:
| Level | Can lose and still scan | Cost | Use it for |
|---|---|---|---|
| L | 7% | smallest code | A large, clean code that must hold a lot of text |
| M | 15% | the default | Ordinary codes on screens and paper |
| Q | 25% | larger code | Codes that will be handled, folded or printed on rough surfaces |
| H | 30% | largest code (the address above grows from 29 to 37 modules) | Codes with a logo, or outdoor codes that will weather |
Higher correction is not free: the code gets denser, so for the same print size the modules get smaller. M is the right default. Go to H when you put a logo in the middle, because the logo is, to the reader, damage.
Rule five: a logo may cover only what the correction can repair
A logo hides modules. At level H the reader can rebuild up to 30% of the data, but that figure includes any other damage, so a logo should cover far less. Our generator raises the correction to H as soon as you add a logo and warns when the logo covers more than about 12% of the code, because beyond that the margin for a scuff or a reflection is gone. At level L the safe limit is only 2%, which is why generators that leave the level alone produce codes with logos that scan on a good day and fail in a shop.
Two more things about logos. Keep the logo away from the three finder squares in the corners and the small alignment squares, which have no error correction of their own; our generator draws those as solid shapes whatever dot style you choose for that reason. And give the logo a small white box, so its edges do not blur into the modules around it.
Try it: QR Code Generator
Dots, corners, colours, a logo, a frame with a caption, and a scan check that reads the code back before you download it as PNG or SVG.
Static or dynamic, and why it matters in three years
A static code holds the content itself. The web address, the Wi-Fi details or the vCard are in the pattern, and the code works as long as the thing it points to exists. Nobody can switch it off.
A dynamic code holds a short link to a service, which then forwards to your real address. The upside is that you can change the destination later and count scans. The downside is that the code works only while the service does and while you pay for it. Menus, signs and product packaging printed with dynamic codes from a service that closed, or from a free trial that ended, now lead to an error page. If you need a destination you can change, put the code on a page of your own website and change that page.
Every code made with the generator on this site is static: the content goes into the pattern, nothing is sent to a server, and there is nothing to expire.
Test it before you print a thousand
The generator reads each design back with a QR reader before it says “Scans correctly”, but a camera in the real world is a harder test than a clean image. Before a large print run:
- Print one at the final size on the final material.
- Scan it with an iPhone camera and with an Android camera, in the light where it will be used.
- Scan it from the far end of the intended distance, and at an angle.
- If it is going behind glass or in a laminate, test that too: reflections are the commonest cause of codes that worked on the desk and fail on the wall.
If any of those fail, make the code larger or the content shorter, in that order. Changing the dot style or the colours rarely fixes a scanning problem and sometimes causes one.
Frequently asked questions
How small can a printed QR code be?
About 2 by 2 cm for a code scanned from a hand’s length, as on a business card or a menu, provided the content is short. Scanned from further away, divide the distance by ten: a poster read from 3 metres needs a code about 30 cm across.
Do QR codes expire?
A code that holds the text itself (a web address, a Wi-Fi password, a vCard) never expires; it is just a picture of that text. Codes from services that point to a short link they host stop working when the subscription ends or the service closes. Every code made on this site holds the text itself.
Which error correction level should I choose?
M (15 percent) for an ordinary code on screen or paper. H (30 percent) if you add a logo or the code may get scuffed; our generator switches to H automatically when you add a logo. L (7 percent) only when the code is clean, large and must hold a lot of text.
Can a QR code contain Arabic or Urdu text?
Yes, as long as the generator encodes the text as UTF-8, which ours does. Some older generators encode in Latin-1 and turn Arabic into question marks. Scan the code with a phone before printing it.
Should I print a QR code as PNG or SVG?
SVG for anything printed: it scales to any size without blur. PNG for screens, messages and documents that do not accept SVG; export it at 1,000 pixels or more so a printer can still use it.
Written by Saad Naeem
AI engineer in Doha who builds every tool on ToolboxHere. The figures in the guides come from the official sources named in them or from the tools themselves. Found a mistake? Tell us and it is corrected.