How QR Codes Work and How to Create One That Scans Every Time
QR codes now sit on shop counters, bills, menus and posters. They look like random squares, but each one follows strict rules that make it easy for a phone camera to read. Understanding those rules also helps you make codes that scan on the first try.
What a QR code is
QR stands for Quick Response. It is a two-dimensional barcode that stores data in a grid of black and white squares called modules. It was invented in 1994 by Denso Wave, a Japanese company, to track car parts, and its design is an open standard that anyone can use.
A normal barcode holds a short number and reads in one direction. A QR code holds much more, and can be read from any angle. A large QR code can store up to 7,089 digits, 4,296 letters and numbers, or about 2,953 bytes of general text.
The parts of a code
- Three large squares in the corners are finder patterns. They tell the scanner where the code is and which way it is turned.
- A smaller square near the fourth corner in larger codes is an alignment pattern, which helps with curved or tilted surfaces.
- Timing patterns, alternating dark and light modules, show the size of the grid.
- The data area holds your message, plus extra error-correction information.
- The quiet zone is the blank border of at least four modules around the code. Without it a scanner can confuse the code with its surroundings.
Error correction
QR codes include redundant data using a method called Reed-Solomon error correction, so a code can still be read when part of it is dirty, scratched or covered. There are four levels:
| Level | Recovers up to | Typical use |
|---|---|---|
| L | about 7% | Clean screens, short text |
| M | about 15% | General use |
| Q | about 25% | Printed material |
| H | about 30% | Rough surfaces, or a logo placed in the middle |
Higher levels make the code denser, because they add more error data, so a longer message needs a bigger code at the same level.
Static and dynamic codes
A static code stores your content directly. It never expires, but you cannot change where it points once it is printed. A dynamic code stores a short redirect link that a service can later point somewhere else, which is useful for marketing, but it depends on that service staying online and often needs a paid plan. For a menu, a Wi-Fi password or a profile link that rarely changes, a static code is simple and reliable.
Making a code that scans reliably
- Keep strong contrast. Dark code on a light background works best. Avoid inverted (light on dark) designs, since some scanners cannot read them.
- Leave the quiet zone. Do not crop the border or place text close to the code.
- Keep the message short. Fewer characters give a simpler pattern with larger modules, which is easier to read.
- Make it big enough. A rule of thumb is that the scanning distance should be about ten times the code width. A code read from one metre away should be about 10 cm wide. Printed on a card, keep it at least 2 cm across.
- Test before you print. Scan the final design with two or three different phones, in normal and low light.
- Do not stretch it. Keep the width and height equal.
Staying safe with QR codes
A QR code can hide a link as easily as a visible one, so criminals sometimes paste a fake code over a real one, a trick called quishing. Look at the address your phone shows before you open it. Be careful with codes that ask you to log in, make a payment, or install an app, especially if they are stickers on a public poster. With UPI payments, check the name of the payee before you confirm. If you use a code for your own business, check it regularly to make sure nobody has covered it.
What you can put in one
Common uses include a website address, plain text, a WhatsApp chat with a pre-filled message, a YouTube video, or a social media profile. Our QR Code Generator creates all of these, lets you pick the size and the colours, and runs entirely in your browser, so the data you enter is not uploaded anywhere.