All guides
File Optimization 7 min readUpdated October 2026

How to Generate and Print QR Codes That Scan Reliably

A how-to for making QR codes that actually work: pick the right version and error-correction level, size the code for its scanning distance, leave the quiet zone intact, and test before you print.

Step 1 — Understand what a QR code actually is

A QR code is a two-dimensional barcode: a grid of black and white modules arranged in a square, encoding data in both dimensions at once. Where a traditional linear barcode stores a short number along one axis, a QR code stores arbitrary bytes — URLs, plain text, Wi-Fi credentials, contact cards — in a pattern that a camera and a decoding algorithm can read in a fraction of a second.

Three large square finder patterns in the corners let the scanner locate and orient the code from any angle, which is why QR codes work when photographed casually rather than precisely aligned. Timing patterns running between the corners let the decoder establish the grid scale, and a quiet zone — a mandatory margin of blank modules around the code — gives the scanner a clean boundary to detect. Cutting the quiet zone to make the code fit a design is the most common self-inflicted scanning failure.

Step 2 — Match the version to your data

QR codes come in 40 sizes, called versions. Version 1 is a 21×21 module grid; each subsequent version adds four modules per side, up to version 40 at 177×177. Larger versions hold more data, but denser grids are harder for a phone camera to resolve — more modules in the same physical space means each module is smaller, and there is a physical limit below which a camera at arm's length cannot distinguish them.

Capacity depends on both the version and the encoding modes. Numeric data is the most compact, alphanumeric slightly less, and byte mode — which is what a URL uses — the least efficient per character. As a practical anchor: a typical URL of 30–60 characters fits comfortably in a mid-range version that remains easy to scan. If you find yourself encoding a long URL, shortening it first with a link shortener you control both improves scannability and gives you the ability to change the destination later.

Step 3 — Choose the error-correction level

QR codes apply Reed–Solomon error correction, which allows a scanner to reconstruct the data even when part of the code is damaged, obscured, or poorly printed. There are four levels: L recovers about 7% of the codewords, M about 15%, Q about 25%, and H about 30%. Higher correction means more redundancy, which means fewer bytes available for your actual data — so capacity and robustness trade off directly.

For a code on a clean poster scanned at close range, level M is the sensible default. Level H is worth its capacity cost when the code will be printed small, placed somewhere it may get scuffed or partially covered, or etched onto a surface with texture. A useful property of high error correction: you can deliberately overlay a small logo in the centre of the code and it will still scan, because the redundancy absorbs the occlusion — this is how branded QR codes work.

What error correction cannot do is rescue a low-contrast or blurry code. Correction operates on the decoded module values; if the camera cannot tell black from white in the first place, there is nothing to correct. Contrast, sharpness, and size are prerequisites, not enhancements.

Step 4 — Size the code for print

The working rule for print sizing is the distance ratio: the code should be at least one tenth of the distance from which it will be scanned. A code on a business card scanned from 20 cm needs to be roughly 2 cm across; a code on a wall poster scanned from two metres needs to be around 20 cm. Going larger than the rule is always safe — scanning gets easier, not harder.

Resolution matters at the generation stage. Generate the code as a PNG at 512×512 or larger for print so each module carries several pixels; a code generated at 128px and then scaled up in a layout program becomes soft-edged, and soft edges are exactly what decoders struggle with. Leave the white quiet zone intact — do not crop to the finder patterns, and do not invert the colours (white code on black background) unless you have tested it, because some scanners assume dark modules on a light background.

Step 5 — Test before you print the run

Always test a printed code with more than one phone before a print run. Paper texture, ink bleed on uncoated stock, and lamination glare can all degrade a code that looked perfect on screen. A test print of one copy costs minutes; discovering the failure after five thousand flyers are distributed does not.

When you generate the code, keep the content short and public. The QR Code Generator on this site produces static codes: the image is yours, with no click-tracking built in. For a Wi-Fi password or a private contact card, remember that the content you encode is sent to a third-party rendering service in the request that draws the code — so reserve QR generation for public, non-sensitive content, or use an offline generator for credentials you would not otherwise share.

The medium you print on affects scannability as much as the code itself. Matte stock produces crisp, high-contrast modules that scan reliably; glossy stock can reflect light directly into the camera, washing out parts of the code at certain angles. Lamination adds durability but also adds glare, so test a laminated sample under the lighting conditions where it will be scanned. For outdoor use, UV-stable inks prevent the black modules from fading over months of sun exposure, which would gradually erode the contrast the scanner depends on. These material considerations are not afterthoughts — a code that scans perfectly on a laser printer in the office can fail entirely once it is printed on the wrong stock and placed in the real world.

A worked example: sizing a code for two contexts

Suppose you are generating a QR code for a restaurant menu URL of 45 characters. At byte encoding, that fits comfortably in a mid-range version (around version 4, a 33x33 module grid), leaving headroom for error correction. The same code is going on both a table tent (scanned from 30 cm) and a window decal (scanned from 1.5 metres).

The distance rule says the code should be at least one-tenth of the scanning distance. For the table tent, that is 3 cm minimum; for the window decal, 15 cm minimum. A 3 cm code on a window scanned from across the pavement will fail, not because the data is too dense, but because each module is physically too small for a phone camera at that distance to resolve. The remedy is not a different version — it is a larger physical print for the longer scanning distance.

Choose error correction by environment, not habit. Level M (15%) for the clean indoor table tent; level H (30%) for the window decal, which faces sunlight, condensation, and possible scratching over months. The capacity cost of H is real — it reduces the data that fits in a given version — but for a 45-character URL there is headroom to spare, so the robustness is free. The framework: match version to data length, match physical size to scanning distance, and match error correction to the wear the code will endure. Get all three right and the code scans reliably for its lifetime; get any one wrong and no amount of correction rescues it.

Step 6 — Treat unfamiliar codes with caution

A static QR code encodes its content directly and permanently: the image is the data. It needs no server, works forever, and cannot be tracked through the code itself. A dynamic QR code encodes a short URL that redirects to the real destination — which means the destination can be changed after printing, and the operator of the redirect can count scans. UtilityAIWorkspace's generators produce static codes.

Finally, treat a QR code you did not create with the same caution as a shortened link: it is an opaque pointer to an unknown destination. Scanning a stranger's code is clicking a link you cannot preview — reasonable for a restaurant menu, worth a second thought for a sticker on a lamppost.

Contrast is the final prerequisite. A QR code works because the scanner can distinguish dark modules from light ones; reduce that contrast — with a colored code on a tinted background, or a code printed in a light gray — and the decoder starts failing long before the human eye notices a problem. Pure black on pure white is the safe default; any departure from it should be tested on a real device, because what looks clearly readable on screen can fail to scan in print, where ink spread and paper texture soften the edges further. Treat contrast as a hard requirement alongside size and quiet zone, not as a design preference.