elefcode
← All guides

Tools · 4 min read

How QR Codes Work: Error Correction, Size, and Safety

A QR code is a two-dimensional barcode that stores up to a few thousand characters — usually a URL, but also Wi-Fi credentials, contact cards, or plain text.

Try it yourself with the related tool.

Create a QR code →

Advertisement

What the squares mean

The three large squares in the corners are finder patterns that tell a scanner where the code is and which way up it is. Smaller alignment and timing patterns help with distortion. The remaining modules encode the data plus error-correction information.

Error correction

QR codes use Reed–Solomon error correction at four levels: L (about 7% recoverable), M (15%), Q (25%), and H (30%). Higher levels make the code denser but let it scan when scratched, dirty, or partly covered by a logo. Use M for most uses and H if you place a logo in the middle.

Size and contrast

Keep the content short — a short URL produces a simpler code that scans from further away. As a rule of thumb, the code should be at least one tenth of the scanning distance wide. Keep a quiet border of four modules, and print dark on light; inverted codes do not scan on every phone.

Static codes and safety

A static QR code contains the data directly and works forever. "Dynamic" codes point to a redirect service that can be changed — or switched off if the service shuts down. Because people cannot read a QR code before scanning it, scammers stick fake codes over real ones on parking meters and menus; always check the address your phone shows before opening it.

Related guides