My Tool Studio
Generators·4 min read

How QR Codes Work: Error Correction and Print Size

Scan a restaurant table tent and a menu opens; that little grid is doing more engineering than it lets on. Understanding how qr codes work makes you better at producing them: you'll know why some codes scan from across a room while others fail at arm's length, what the four error correction levels sacrifice for their resilience, and how large a print run needs to be. This guide covers the module grid, the redundancy math, sizing rules with actual numbers, and the production mistakes that quietly sink scan rates.

QR

The QR code's second life on every table and package

From factory floors to your dinner menu.

Denso Wave invented the format in 1994 to track car parts, and for two decades it stayed industrial. Then payment apps in Asia normalized scanning, camera apps gained native detection, and 2020 put a QR code on every restaurant table in the world. Today the grid moves menus, boarding passes, payment handoffs, WiFi credentials, and product registration cards.

That ubiquity hides variety. A code that performs beautifully on a phone screen can fail on a billboard, and one that scans in an email footer can misfire on a curved bottle. The physics is the same; the parameters change.

How QR codes work: modules, versions, and masks

A QR code is a square grid of modules, the black and white cells, ranging from version 1 at 21 by 21 up to version 40 at 177 by 177. Three large finder squares in the corners let a camera locate and orient the code from any rotation, while timing lines calibrate module spacing.

Your data is encoded into bits, laid into the grid in a zigzag, then XORed with one of eight mask patterns chosen to break up large blobs of a single color that would confuse scanners. The encoder picks whichever version is just big enough, which is why short URLs give you sparse, forgiving grids and long ones give you dense thickets.

Error correction levels, the QR code's spare tire

Every code reserves part of its capacity for Reed-Solomon error correction codewords, redundant data that lets a scanner reconstruct what dirt, glare, or a staple destroyed. The four error correction levels set the size of that reserve: L recovers about 7 percent damage, M about 15, Q about 25, and H about 30.

The tradeoff is density. Redundancy consumes capacity, so the same URL at level H needs a bigger version, and therefore smaller modules at the same print size, than it does at level L. Level M is the pragmatic middle and is what this generator's rendering library applies, while H earns its keep mainly when a logo will be stamped over the center, deliberately sacrificing modules the spare capacity can absorb.

A worked QR code example, from URL to grid

Take a concrete case. Input: https://example.com/menu, 24 characters. At medium error correction that fits version 2, a 25 by 25 grid. Rendered at this tool's default 320 pixels, each module lands around 11 pixels wide, enormous by scanning standards, which is why short URLs scan so effortlessly.

Now paste a 180 character tracking URL instead. The encoder climbs to roughly version 8, a 49 by 49 grid, and each module shrinks below 6 pixels at the same render size. Nothing else changed, yet the code became twice as fussy about focus, lighting, and distance. Payload length is the single biggest lever you control.

Print size and scan distance for QR codes

The field rule for print size and scan distance: make the code at least one tenth as wide as the distance it will be scanned from. A counter card read at 25 centimeters needs 2.5 centimeters of code. A poster read from 3 meters needs 30 centimeters. A trade show banner read across an aisle needs more than most designers first sketch.

For translating pixels to paper, a 320 pixel PNG printed at 300 DPI comes out about 2.7 centimeters wide, fine for handheld range and too small for wall duty. The SVG download sidesteps the arithmetic entirely, since vectors rescale to any physical size without softening the module edges.

QR code mistakes that tank scan rates

Field failures trace back to a short list of causes:

  • Inverting the palette; light modules on a dark background defeat a surprising share of scanners, so keep the foreground darker than the background.
  • Brand color pairs with weak contrast, like mid-gray on beige, that look elegant in a mockup and read as mush to a camera sensor.
  • Encoding the full campaign URL with every UTM parameter attached, when a shortened link would drop the grid three versions.
  • Scaling up a small PNG for large format print instead of exporting SVG, which blurs the module boundaries scanners depend on.
  • Crowding artwork against the code's edges; this tool always includes a quiet zone margin, so preserve it in your layout.

Three checks before your QR code meets a printer

Print one test sheet at final size and scan it under the venue's actual lighting, with an older phone if you can find one, since flagship cameras forgive sins that budget sensors won't. Shorten every URL before encoding so the grid stays sparse. And confirm the destination page is mobile friendly, because a flawless scan into a desktop-only page still loses the visitor.

QR Code Generator or one of the specialized QR tools

This page is the generalist: any text, any URL, custom colors, PNG and SVG output. The WiFi QR Generator and vCard QR Generator exist because their payloads follow strict field formats that are tedious to hand-assemble, and the Bulk QR Generator takes over when the job is a hundred codes from a list rather than one. For 1D symbologies like Code 128 or EAN-13, that's the Barcode Generator's territory.

Try it now

Open QR Code Generator

The tool is one click away. No sign up, no upload, no payment.

Open QR Code Generator