The café menu is a QR code on the table now, and so is the guest Wi-Fi, the concert ticket and the parking meter. Making one takes seconds. Making one that still scans when it’s printed small, a bit scuffed, or stuck behind a glossy sticker takes a little more knowledge.
What a QR code is
QR stands for Quick Response. Denso Wave, part of the Toyota group, invented the format in 1994 to track car parts in factories. A normal barcode stores data in one direction, as a row of stripes. A QR code stores it in a two-dimensional grid of squares, so it holds far more in the same space.
The largest QR code holds up to 7,089 digits, 4,296 alphanumeric characters or 2,953 bytes. Most codes carry much less: a URL, a short piece of text, or a small structured payload such as Wi-Fi settings or a contact card.
How QR encoding works
You don’t need this to make a code, but it explains why the settings later on matter. Each small square in the grid is called a module. A generator goes through four steps to decide which modules are dark.
1. Choosing a mode
The standard defines four data modes: numeric (digits only), alphanumeric (digits, uppercase letters, space and $%*+-./:), byte (any bytes, usually UTF-8 text) and kanji (Japanese double-byte characters). An encoder picks the mode that gives the shortest bit stream.
2. Encoding the data
The data is turned into bits according to the mode. In numeric mode, each group of three digits becomes a 10-bit number. In byte mode, each byte takes 8 bits.
3. Adding error correction
The encoder adds extra recovery data, calculated with Reed-Solomon codes, the same family of maths used on CDs. It lets a scanner rebuild the message when part of the code is dirty, torn or covered by a coffee ring.
4. Building the grid
The data goes into the grid around some fixed landmarks: the three big squares in the corners (finder patterns), smaller alignment and timing patterns, and a strip that records the settings used. Finally one of eight mask patterns is applied to even out dark and light areas, which makes scanning more reliable.
Error correction levels
There are four levels. Higher levels survive more damage but need more space for the same data.
| Level | Recovers up to | Typical use |
|---|---|---|
| L (low) | About 7% | Screens and clean prints where capacity matters most |
| M (medium) | About 15% | The usual default |
| Q (quartile) | About 25% | Packaging and labels that may get scratched |
| H (high) | About 30% | Codes with a logo on top, or harsh conditions |
For a short URL, even level H gives a compact code.
Versions and capacity
The specification defines 40 versions. Version 1 is a 21 by 21 grid, and each version adds 4 modules per side, up to 177 by 177 for version 40. The encoder picks the smallest version that fits the data at the chosen error correction level. Most URLs fit in versions 1 to 10. Denser codes need to be printed larger to scan well.
What to encode
Links
The most common case. Phone cameras open the URL when they scan the code. Shorter URLs give smaller, easier-to-scan codes.
Wi-Fi networks
No more reading a 16-character password off the back of a router. A Wi-Fi code uses this text format, and Android and iOS cameras offer to join the network when they scan it.
WIFI:T:WPA;S:Cafe Lisboa Guest;P:pastel-de-nata-42;;T is the security type (WPA, WEP or nopass), S the network name and P the password. If the name or password contains ;, ,, : or \, put a backslash before it.
Contact cards
A vCard holds a name, phone numbers, email, company and address. Scanning it offers to save the contact, which beats watching someone type your email address wrong at a conference.
BEGIN:VCARD
VERSION:3.0
N:Okafor;Ada
FN:Ada Okafor
ORG:Northwind Bikes
TEL:+1-555-0100
EMAIL:ada@northwind.example
END:VCARDPayments
UPI in India, PIX in Brazil and many crypto wallets use QR codes that carry the recipient, amount and a reference. These follow each system’s own format, so generate them with the payment provider rather than by hand.
Tickets and boarding passes
Airlines, cinemas and event organisers encode a ticket ID. The scanner at the gate looks it up to let you in.
Size, colour and quiet zone
- Module size. Each small square is a module. Bigger modules scan from further away. For print, aim for modules of at least about 0.5 mm, and more for codes scanned from a distance.
- Quiet zone. The standard requires an empty border at least 4 modules wide on every side. Cropping into it can stop scanners finding the code.
- Contrast. Use a dark foreground on a light background with strong contrast. Light-on-dark codes work with many phone cameras but not with every scanner.
- Logos. A logo in the middle hides modules, so use level H and keep the logo small, around a fifth of the code area or less.
Generating a QR code with PulpMiner
- Open the QR code generator and type or paste a URL or any text. For Wi-Fi or a contact card, paste the formatted text shown above.
- Pick a size (Small, Medium or Large, which draw each module 4, 8 or 12 pixels wide) and the foreground and background colours.
- Select Generate QR code, then Download PNG. Changing the size or colours afterwards redraws the code.
The generator runs in your browser. It always uses error correction level M, picks the smallest grid that fits your text, and adds the 4-module quiet zone for you. Inputs can be up to about 2,300 bytes, which is far more than a URL needs.
If you need level H (say, for a logo) or an SVG file, use a library such as qrcode for Node.js or Python instead.
Tips for reliable scanning
- Test on several phones, at least the default camera apps on iOS and Android.
- Keep the data short. Less data means a smaller grid with larger modules.
- Print it big enough. A common rule of thumb is that a code can be scanned from about 10 times its width, so a 2.5 cm code works from about 25 cm.
- Do not stretch it. Keep the code square.
- Export large for print. Use the Large size, or a vector format from a library, so the code stays sharp when scaled.
- Avoid glossy surfaces, which cause glare. Matte finishes scan better.
- Add a label such as “Scan for the menu” so people know what the code does.
Static and dynamic QR codes
A static code contains the final content directly. It cannot be changed after printing, so a new URL needs a new code.
A dynamic code contains a short redirect URL run by a third-party service. You can change where it redirects at any time, and the service can count scans. The catch is that if the service shuts down or you stop paying, 5,000 printed flyers point nowhere. For most links a static code is enough, and the PulpMiner generator makes static codes.
