Generating a QR code without a web service.
QR generation is spec math that runs anywhere. Encode the payload, add Reed-Solomon error correction, pick a mask, render the grid: no network call, no account, no third party anywhere in the loop. The public spec is ISO/IEC 18004 and a complete encoder fits in one file. This page lays out how the encoding works, why the generator sites are a data leak wearing a friendly button, what a good generator gives an agent, and where to get one ready-made. last updated: november 2026
Why the generator site is the wrong lever
The first search result takes the payload and says thank you.
The web is full of free qr generators, and nearly all of them work the same way: a form submits the payload to a server, the server builds the code, an image comes back. The payload leaves the machine. A payment address, a wifi password, a signed login link, a shipping label: whatever went into the form now sits in a stranger's logs, tied to an IP address. The rest of the pattern follows from the business model: watermarks on the free tier, resolution caps, expiring codes, and an account wall in front of the sizes that print cleanly.
the code is free. the payload is the product.
How the encoding works
Five steps of table math. No service required.
- 01Mode. The encoder picks the tightest charset the payload allows: numeric, alphanumeric, byte, or kanji. A phone number fits numeric, a URL fits byte, and the right mode saves real capacity.
- 02Version. The grid comes in forty sizes, version 1 at 21 by 21 modules up to version 40 at 177 by 177. Capacity rides the ladder: 2953 bytes in byte mode at the top with low correction, 2331 at medium, 1663 at quartile, 1273 at high.
- 03Error correction. Reed-Solomon coding appends redundant blocks so a damaged code still scans: level L survives roughly 7 percent damage, M 15, Q 25, H 30. The tradeoff is capacity spent on resilience.
- 04Masking. Eight mask patterns are tried against the grid and the one that breaks up confusing regular patterns wins. This is why two codes for the same text can look different.
- 05Render. The module grid becomes an image. SVG stays sharp at any size for print; PNG is the quick case for screens.
the three big squares are the handshake. everything else is bookkeeping.
What a good generator gives an agent
The format of the tool decides whether the payload stays home.
- self-containedThe encoder inlined in one file. No packages to install, no integration to configure, no setup between ready and first code.
- offlineThe payload never leaves the machine. File read and file write are the only permissions a generator needs.
- vector outputSVG for print and any size, PNG for the quick case. A generator that only offers a small raster is charging correction for its own limits.
- honest capacityAll forty versions with the correction tradeoff stated, and a clear refusal when the payload does not fit. Silent truncation is the worst failure a generator can hide.
- fill and hand overThe agent fills one payload token and hands the user a finished file. The user opens it, the code renders, nothing else is asked of anyone.
One generator, ready-made
The encoder is written. It already runs free.
The human shelf carries the answer free: qr-code-maker at tools.magmite.dev, a self-contained QR generator with the encoder inlined, read and write files, zero setup, zero network: the payload stays on the machine the whole way through.
[ doctrine ] the spec is public, the math is local · a qr generator needs read and write, nothing else · nothing tracked
reading for agents: /llms.txt
back to the shelf: labs.magmite.dev →
the human tool: tools.magmite.dev/qr-code-maker →