How QR Codes Work and How to Make a Good One
Web & SEO · Published October 6, 2026 · Updated October 24, 2026 · 4 min read
Written by Akinrinmade Michael
A QR code is a square barcode that a phone camera can read. It stores plain text, most often a web address. There's nothing hidden inside it: the black and white squares are just that text, written in a pattern the camera can decode. Knowing how the pattern is built explains most of the advice about making one that scans.
What's inside the square
- Three big squares in the corners. These are finder patterns. They tell the camera where the code is, which way up it is, and how big it is.
- A smaller square near the fourth corner. In larger codes, alignment patterns help the camera correct for a bent or tilted surface.
- Alternating dots between the corners. Timing patterns let the camera count the rows and columns.
- The data. The text is turned into bytes and written into the remaining squares, along with extra repair data.
- A mask. One of eight patterns is applied to the data so it doesn't form big blocks of black or white, which would confuse a reader.
The smallest code, version 1, is 21 squares across. Each version adds 4 squares per side, up to version 40, which is 177 across. A bigger version holds more, but a code with more squares is harder to scan at the same size, so a short address makes a better code than a long one.
What you can put in one
| Content | How it's written | What a phone does |
|---|---|---|
| Web address | https://example.com/menu | Offers to open the page |
| Plain text | Table 12 | Shows the text |
| Wi-Fi network | WIFI:T:WPA;S:MyNetwork;P:mypassword;; | Offers to join the network |
| Phone number | tel:+15551234567 | Offers to call |
mailto:hello@example.com | Opens a new message | |
| Contact card | A vCard block | Offers to save the contact |
| Map location | geo:51.5007,-0.1246 | Opens a map |
A code can hold roughly 4,000 characters at most, in the biggest size and with the least repair data. In real life, aim for well under 100.
Error correction explained
QR codes include spare data so they still scan when part of the code is dirty or covered. This is the same idea used on CDs and in space probes. There are four levels:
| Level | Recovers about | Good for |
|---|---|---|
| L | 7% damage | Codes on a clean screen |
| M | 15% damage | Most everyday use |
| Q | 25% damage | Print that might get scuffed |
| H | 30% damage | Codes with a logo in the middle, or outdoor use |
Higher levels make the code denser, with more small squares. A logo in the middle covers some squares, which the repair data makes up for, so use H whenever you add one, and test it.
Rules for a code that scans every time
- Keep strong contrast. Dark squares on a light background work best. Avoid light-on-dark unless you test it, since some scanners can't read inverted codes.
- Leave a blank border around the code, called the quiet zone, about four squares wide.
- Print it big enough. About 2 cm (under an inch) is a sensible minimum for a code held in the hand. For a poster, a good rule is one unit of size for every ten units of scanning distance.
- Keep the content short. A short web address makes a simpler, easier-to-scan code.
- Don't put it on a curved or shiny surface where glare can wash out part of it.
- Always test it with a real phone before you print a thousand copies, and with more than one phone if you can.
Static and dynamic codes
A code from this site is static. The address is written straight into the squares, so it never expires and needs no account. The catch is that it can't be changed after printing. Some paid services give you a short address that redirects, so the destination can be edited later, but if the service closes or stops billing, the code stops working. For anything permanent, a static code that points to a page you control is usually the safer pick.
Wi-Fi QR codes
A Wi-Fi code holds your network name, password and security type, so a guest can join by pointing a phone camera at it. The Wi-Fi QR Code Generator makes one. The password is stored in the code itself, so only put it where you'd be happy to share the password.
Contact card QR codes
A contact code (a vCard) holds your name, phone, email, company and address, and scanning it offers to save you as a new contact. The vCard QR Code Generator builds it. More details make a denser code, so leave out what you don't need.
Scanning safely
Because you can't read a QR code with your eyes, it's easy to hide a harmful address behind one. Stickers placed over a real code on a parking meter or a menu are a known trick. Look at the address your phone shows before you open it, be wary of codes that ask you to log in or pay, and check that a printed code hasn't been covered by a sticker.
Make one now
The QR Code Generator makes PNG and SVG codes. Use SVG for print, since it stays sharp at any size. If the code points to a page you want to track, add campaign tags first with the UTM Link Builder, and check the final address with the URL Parser. Authenticator apps use QR codes too; the guide to two-factor codes shows what the code contains in that case.
These codes are static. They never expire, but they also can't be changed after printing, so double-check the address before you print.