A QR code stores data as a grid of black and white squares called modules, which a camera reads in two directions instead of one like a barcode. The three large square marks in the corners are position detection patterns, built with a distinctive 1:1:3:1:1 ratio of black and white widths, so a scanner can find the code and work out its orientation from any angle (DENSO WAVE, “History of QR Code”). The scanner then decodes the data modules, and Reed-Solomon error correction lets it rebuild missing data if part of the code is dirty or damaged: users choose one of four levels (L, M, Q, H), with Level M (about 15%) the most common (DENSO WAVE, “Error Correction Feature”).
QR codes come in 40 versions, from 21 × 21 modules (Version 1) to 177 × 177 modules (Version 40); more data requires a larger version. DENSO WAVE released the QR (“quick response”) code in 1994 and chose not to enforce its patent, which helped it become a free, ISO-standardized format.
Source: DENSO WAVE, “History of QR Code” (qrcode.com).
Image: QR Code Structure Example 3, by Bobmath. CC BY-SA 3.0, via Wikimedia Commons.