How to make a QR code that always scans
By M Alamgir Saeed · Updated
QR codes are everywhere: on menus, posters, business cards and parcels. Making one takes seconds, but a code that is too small, too low-contrast or printed without testing can fail at the worst moment. Here is how to create one that works every time.
What a QR code is
QR stands for "Quick Response". The format was invented in 1994 by Denso Wave, a Japanese company, to track car parts, and it was later made an international standard. A QR code stores text, such as a web address, in a square grid of black and white modules that any phone camera can read.
Everything a QR code does comes down to that stored text. A link is just text that starts with https://, and a Wi-Fi code is text in a special format that phones recognise. The phone reads the text and decides what to offer: open a page, join a network, start an email or dial a number.
Step by step
- Open the QR Code Generator and pick a tab for what the code should contain: URL, Text, Wi-Fi, Email, Phone or SMS.
- Type or paste the content. The preview updates as you type.
- Open "Customise colours, size and quality" if you want to change the colours, the size, the error correction level or the margin. Keep strong contrast: dark code on a light background.
- Read any warning under the preview, such as colours that are too similar or a margin that is too small, and fix it.
- Click Download PNG for screens and documents, or Download SVG for printing at any size.
- Scan it with at least two different phones before you print anything.
What each type of code contains
Each tab builds a different piece of text for the code. Knowing what goes inside helps when a code does not do what you expected.
| Tab | What you enter | What the phone does |
|---|---|---|
| URL | A web address; https:// is added if you leave it out | Offers to open the page |
| Text | Any text | Shows the text |
| Wi-Fi | Network name (SSID), security type, password, and whether the network is hidden | Offers to join the network |
| Email address, optional subject and message | Opens a new email, filled in | |
| Phone | Phone number with country code | Offers to call the number |
| SMS | Phone number and optional message | Opens a text message, filled in |
Making a Wi-Fi QR code
A Wi-Fi code saves guests from typing a long password. In the Wi-Fi tab, enter the network name exactly as it appears on your router, including capitals and spaces, choose the security type (WPA / WPA2 / WPA3, WEP, or No password), and type the password. Tick Hidden network only if your network does not broadcast its name.
The generator handles special characters for you: a semicolon, comma, colon, quote mark or backslash in the name or password is escaped so phones read it correctly. If a phone fails to join, the usual cause is a typo in the network name or password, or the wrong security type.
Remember that the password is stored in the code as plain text. Anyone who can photograph the code can join your network, so for a café or an office lobby, point the code at a guest network rather than your main one.
Error correction: why some damage is fine
QR codes contain extra data so they still scan when part of the code is dirty, torn or covered. There are four levels: L restores about 7 percent of the code, M about 15 percent, Q about 25 percent and H about 30 percent. Level M is the most common choice, and it is the default in our generator, where the levels are labelled Low, Medium, Quartile and High.
A higher level makes the code denser but tougher, which is useful for codes that will be printed on packaging or placed outdoors. The trade-off is capacity: the same text needs more modules at level H than at level L. If the generator says there is too much data for one QR code, shorten the text or choose a lower level.
Size, contrast and placement
- Print it large enough: about 2 x 2 cm is a practical minimum for a short link held close to the camera; bigger for posters seen from a distance.
- Keep a quiet zone, a plain margin around the code, so the camera can find its edges. The generator's default margin is 4 modules, which is the width the QR standard calls for.
- Use dark modules on a light background. Inverted or low-contrast codes fail on many phones.
- Keep the content short. A short link produces a simpler code that scans faster.
- Avoid curved or shiny surfaces where possible; glare and bending distort the grid.
How big should a printed QR code be?
A common rule of thumb is that a code can be scanned from about ten times its own width. By that rule, a 2 cm code on a business card works at arm's length, while a code on a poster that people will read from 2 metres away should be around 20 cm across. Treat this as a starting point and test at the real distance, because lighting, camera quality and how much data the code holds all make a difference.
Pixel size and print size are linked by the printer's resolution. Our PNG download is 512 x 512 pixels by default, and the size slider goes from 128 to 1,024 pixels in steps of 32. At 300 dots per inch, a 512-pixel image prints at about 1.7 inches, or 4.3 cm, before it starts to blur. For anything larger, or when you are not sure, use the SVG download: it is a vector file, so it stays sharp at any size.
Colours that still scan
You can change the QR colour and the background, but the camera still needs to tell them apart. The generator measures the contrast between the two colours and shows a warning when they are too similar for many phones to read. It also warns when the code is lighter than its background, because light-on-dark codes do not scan on some phones.
A safe approach is a very dark brand colour for the code, such as navy or deep green, on white or a very pale background. Test colour codes on paper, since printed colours often come out darker or duller than on screen.
Static codes never expire
The codes made here are static: the link or text is stored inside the code itself, so the code works forever and does not depend on any service staying online. The trade-off is that you cannot change the destination after printing. If you might need to, point the code at a page on your own website that you can update.
The code is drawn in your browser by an open-source QR library, so the text you type, including a Wi-Fi password, is not sent to our server.
What to put in the code
Shorter data makes a simpler pattern that is easier to scan from further away. A short web address beats a long one with tracking parameters. Our test code for a web address came out as a 512 x 512 PNG of 8.6 KB; for print, use the SVG download, which stays sharp at any size.
If the address might change, point the code at a page you control and can redirect, because a static code cannot be edited after printing. Resize the PNG for a slide or web page with the Image Resizer rather than stretching it in a design tool, which can blur the edges. To put one or more codes on a printable page, JPG to PDF can turn the image into a PDF.
Test it properly before printing
A code that scans on your laptop screen can still fail on a poster. Print one at the real size and try it with two or three different phones, in normal light and from the distance people will actually stand.
Common causes of failure are too little contrast, a dark code on a dark background, a code printed too small, and a missing quiet zone: the empty margin around the code that scanners need. Keep that margin clear. Light codes on dark backgrounds also fail on some older scanner apps.
Troubleshooting a code that will not scan
- The phone sees nothing: make the code bigger, add more light, or move the camera further back so the whole code and its margin fit in the frame.
- It scans on one phone but not another: raise the contrast, return to black on white, and check the margin is at least 4 modules.
- It opens the wrong page: check the address for typos and make sure it works when typed into a browser.
- The Wi-Fi code does not connect: re-type the network name and password exactly, and check the security type.
- The generator reports too much data: shorten the text or link, or lower the error correction level.
- It printed blurry: go back to the QR Code Generator and download the SVG instead of the PNG, or generate the PNG at a larger size.
Be careful what you scan
QR codes hide their destination, which scammers exploit by sticking fake codes over real ones on parking meters and restaurant tables. Check the address your phone shows before you open it, and never enter a password or card number on a page you reached that way unless you are sure of it.
If you run a shop or restaurant, check your printed codes from time to time to make sure nobody has covered them with a sticker.
Try the free QR Code Generator
Frequently asked questions
Do these QR codes expire?
No. The content is stored inside the code, so it keeps working as long as the link it points to works.
Can I add a logo to a QR code?
The generator does not add logos. A small logo placed over the centre in a design tool can work with a high error correction level, but always test it on several phones before printing.
PNG or SVG?
PNG for websites and documents, SVG for printing because it stays sharp at any size.
Can I make a contact card (vCard) QR code?
There is no contact-card tab. You can use the Email, Phone or SMS tabs to let people reach you in one tap, or the Text tab for any other text.
Can I track how many people scan my code?
Not with a static code, because the phone goes straight to your link without passing through any tracking service. If you need numbers, use a link on your own site whose visits you can measure.
What error correction level should I choose?
Medium (15%) suits most codes. Choose Quartile or High for codes that may get scratched, dirty or partly covered, and Low only when you need to fit a lot of data.