Generators FIELD NOTES · 4 MIN READ
QR Codes Explained: How a Grid of Squares Stores a Link
The anatomy of a QR code: finder patterns, version sizing, the four error-correction levels, mask selection, and tips for a PNG that scans first time.
A QR code looks like visual noise, but nothing on it is decorative: every black-and-white square is either a landmark that helps a camera find the grid, bookkeeping that keeps the grid readable, or your text chopped into bytes and smeared across the pattern with backup copies. Here is what each part does, using the same engine that powers our generator.
The landmarks that make a QR scannable
Three larger squares sit in the top-left, top-right, and bottom-left corners. These finder patterns are the first thing a scanner looks for: their distinctive 1-1-3-1-1 black-white ring lets the camera locate the code from any rotation, and the missing fourth corner tells the scanner which way is up. Between them runs a timing pattern — an alternating dashed line along row 6 and column 6 — from which the scanner measures the size of every small square (called a module). Larger codes add small alignment patterns toward the bottom-right so a bent or photographed print can still be perspective-corrected. Only after the grid is oriented and measured does the scanner start reading data modules, zig-zagging from the bottom-right upward.
Versions: why longer text makes a bigger code
QR codes come in 40 versions, and the side length is pure arithmetic: 4 × version + 17 modules. Version 1 is 21×21; version 40 is 177×177. A generator picks the smallest version that fits your text at the chosen error-correction level, so the code grows in discrete jumps as you type. The jump sizes are unforgiving at the bottom: a version-1 code holds just 14 bytes of text at medium correction (17 at low, 11 at quartile, 7 at high), which is why a short link produces a small, clean code while a long paragraph forces the grid to balloon toward the version-40 ceiling of 2,331 bytes at medium. Trimming the URL before encoding is the cheapest way to shrink a QR code.
Error correction: the built-in redundancy
QR codes carry backup copies of their own data using Reed–Solomon codes — the same math that lets a scratched CD play. Four levels exist, recovering roughly 7% (L), 15% (M), 25% (Q), or 30% (H) of damaged codewords, and every level is a trade: more redundancy means less room for text at the same version. Our QR Code Generator encodes at level M, the everyday middle ground — strong enough to survive a crease or a smudge on a printed sticker, light enough to keep URLs compact. The scanner reads the redundant codewords, notices mismatches, and reconstructs what a coffee stain erased.
Why two generators can draw different codes for the same text
Before data is laid down it is XORed with one of eight mask patterns — checkerboards, stripes, diagonal weaves — chosen to break up accidental blobs that confuse scanners. A generator tries all eight, scores each result against penalty rules (runs of same-color modules, misleading fake finder shapes, unbalanced dark/light ratios), and keeps the best. Different libraries, or different error-correction levels, land on different choices, so the same link can yield visibly different codes that decode to the identical string. Both are valid; the standard has many correct answers.
Size, contrast, and a PNG that scans
The pixel-size option (128 to 512 px) changes only the rendering, never the contents — a 128-pixel code and a 512-pixel code are the same code. What matters for scanning is contrast and breathing room: dark modules on a light background, and the code surrounded by its quiet margin. The generated PNG downloads at whatever size you picked, which is why the larger settings earn their keep on printed flyers rather than on screen.
Try it yourself
Paste a link into the QR Code Generator and watch the version jump as the text grows — then shorten the link and watch it shrink again. For a survey of the sibling text generators, see the generators behind everyday content, and if you need compact input strings, the UUID Generator produces short fixed-width IDs that encode cleanly.