How QR Codes Actually Work

A QR code looks like noise — a scatter of black and white squares with no obvious pattern. It isn't. Every square is doing exactly one job, and the arrangement is precise enough that a phone camera can read it upside down, sideways, half in shadow, or printed the size of a postage stamp. A standard barcode, for comparison, is a single row of stripes holding around 20 characters, and it only works scanned dead straight. Almost everything interesting about a QR code comes from solving that one limitation: turning a line into a grid.

From a line to a grid

Each square in the grid is a single bit, black for one and white for zero, and stringing enough of them together lets the code hold a URL, a WiFi password, a contact card, or several paragraphs of plain text. The exact ceiling depends on what's being encoded: up to 7,089 digits, 4,296 letters and numbers, or 2,953 bytes of raw data in a single code. Most generators default to byte mode, since it handles mixed text without extra configuration.

The code's overall size — its "version," in the language of the spec — scales with how much gets packed into it, from a compact 21-by-21 grid up to a dense 177-by-177 one. Every version, every module, every rule for how the data is laid out is spelled out in ISO/IEC 18004, the international standard that every scanner and generator, including this one, follows to the letter. Nothing about a QR code is proprietary. Anyone can build a reader or a generator, because the entire specification is public.

Why they survive a coffee stain

Look at any QR code and three large squares sit in three of its four corners. Those are position markers, and their only job is orientation — they tell a scanner which way is up, so the code reads correctly whether it's photographed straight on, at an angle, or upside down. Running between them are thin alternating stripes that tell the scanner exactly how large each individual square is supposed to be, which matters once a code gets scaled up or down.

The rest of the grid splits between the actual data and something called error correction, built on Reed-Solomon codes, the same mathematics that keeps a scratched CD or DVD playable. Depending on the correction level chosen, a code can lose anywhere from 7 to 30 percent of its surface to grime, folding, or a logo stamped in the middle, and still scan without a hitch. It's the single cleverest piece of engineering in the format. Everything else is geometry; this is what makes a QR code durable in the real world and not just on a clean printout.

Static or dynamic — pick based on whether you'll change your mind

A static code has its destination baked in for good. Print one, and it points to that address permanently, which makes it the right choice for a WiFi password or a link that will never move. A dynamic code instead points to a short redirect URL that stays under your control, so the underlying destination can change later and so scans can be counted — at the cost of depending on that redirect service staying online indefinitely.

For most personal or small-business uses — a restaurant's menu, a portfolio link, a WiFi network for guests — static is the simpler choice, and it simply works. Save dynamic codes for campaigns where the destination might genuinely change, or where the scan data matters.

Generating the code itself takes seconds with a free QR code generator. The part that actually requires care is making sure it scans reliably once it's printed or displayed — sizing it correctly, leaving a clean border, keeping the contrast sharp — which is closer to a small craft than most people expect.

Ready to make your own?

Create a QR Code