Guide

QR Codes Explained: How They Work and How to Make One That Scans

Updated · 3 min read

How QR codes store links and text, what error correction levels L, M, Q and H mean, how big a QR code should be, and the usual reasons a QR code does not scan.

On this page

A QR code is a two-dimensional barcode: a square grid of dark and light modules that a phone camera can read from any angle. It was invented in 1994 for tracking car parts and now carries links, text, Wi-Fi details and contact cards.

How a QR code is built

  • Three large squares in the corners (finder patterns) tell the camera where the code is and how it is rotated.
  • Timing lines and alignment squares help the camera correct for tilt and curved surfaces.
  • Format information records the error correction level and the mask pattern.
  • Data and error correction codewords fill the rest, protected by Reed–Solomon codes.
  • A quiet zone of at least four modules of white space surrounds the code.

Error correction levels

LevelData that can be restoredUse it when
Labout 7%the code is on a screen or in a clean print and you need to fit more text
Mabout 15%general use; a good default
Qabout 25%the code may get scuffed or printed on rough surfaces
Habout 30%very harsh conditions; the code becomes denser

A higher level makes the code bigger for the same text, so choose the lowest level that is safe for where the code will be used.

The codes made by the QR code generator store your text directly. They are static: they never expire and nothing is tracked or redirected. A code that counts scans or lets you change the destination later is a dynamic code, which needs a service that sits in between.

What to put in it

  • A web address, including the https:// part.
  • Plain text, a phone number (tel:+31…) or an email address (mailto:name@example.com).
  • Wi-Fi: WIFI:T:WPA;S:NetworkName;P:Password;;
  • A contact card in vCard format.

How big should it be?

Print a QR code at least about 2 cm wide for close scanning, and larger when it will be read from a distance. A common rule is a distance of about ten times the width of the code. Longer text makes more, smaller modules, so keep the text short; a short link makes a simpler, easier-to-scan code.

Why a QR code does not scan

  • Low contrast, or light modules on a dark background.
  • No white margin around the code.
  • Printed too small, blurred or stretched.
  • A glossy surface that reflects light, or a curved or creased surface.
  • Too much text for the size.

Always scan a printed sample with a phone before you publish it. If you need a code for products in shops, read how barcodes work, because retail uses EAN and UPC barcodes, not QR codes.

Try the tools

More guides