Toolkit Lab

Guides / QR codes

How QR Codes Work and How to Make a Good One

A QR code is a square grid of black and white modules that stores text, usually a web address. A phone camera reads the pattern and opens the link. The idea is simple, but a few choices decide whether a code scans reliably.

What is inside a QR code

The three large squares in the corners help a scanner find and orient the code. The smaller squares and the timing pattern help it correct for angle and distortion. The rest of the grid holds the data, plus error correction bits that let the code be read even when part of it is damaged.

Error correction levels

You choose one of four levels when you make a code:

Higher levels make the code denser, so it needs to be printed larger.

Print size and contrast

Keep the code at least about 2 cm square when printed, and scan it from the distance people will actually use. Leave a clear margin of white space around it. Use dark code on a light background. Inverted codes, such as white on black, scan poorly on many phones.

Keep links short and test them

Shorter text means a simpler code. Always scan the code with a real phone before printing it, and check the link opens the right page. A code cannot be edited after it is printed, so if the address changes, the code stops working.

Try it yourself

The QR Code Generator lets you choose the size and error correction level, then download the code as a PNG.