Spec & internals
Why QR codes are square
QR codes are square because the format is a matrix symbology, storing data on a fixed square grid the decoder addresses in two dimensions. Three corner finder patterns define position, rotation and perspective, and timing patterns set the grid pitch. Rectangular variants exist — rMQR — but standard QR stays square.
A matrix needs addresses
A QR code is a matrix symbology: every module is a cell at a (row, column) address in a grid, unlike a linear barcode, which is a one-dimensional sequence of bar widths. To read a matrix from a photograph, the decoder must reconstruct that grid — work out exactly where each cell centre sits in the image, despite the photo being rotated, tilted and perspective-distorted.
The square shape is what makes that reconstruction cheap and unambiguous.
Three corners define the plane
The finder patterns in three corners are the key. Three known points are the minimum needed to recover position, rotation, scale and skew — they fix an affine mapping from grid coordinates to image coordinates. The fourth corner is deliberately left empty: the asymmetry is what tells the decoder which way up the code is. Three finders in a square arrangement can only match one orientation, which is why a QR code scans identically at 0°, 90°, 180° and 270°.
For larger versions, where paper curl and lens distortion bend the grid between the corners, alignment patterns pepper the interior as additional reference points, and the alternating timing patterns running between the finders let the decoder count rows and columns and lock the module pitch.
A square grid also makes the version self-describing: every QR version is 17 + 4 × version modules per side, so measuring one side in modules identifies the version — a 29-module side can only be version 3. On a rectangle, side length alone would be ambiguous without extra signalling.
The rectangular exceptions
Square is a design choice, not a law of nature, and the QR family itself contains exceptions:
- Micro QR is still square but uses a single finder pattern to save space, at the cost of needing cleaner captures.
- rMQR (rectangular Micro QR, standardised as ISO/IEC 23941) is exactly what it sounds like — QR technology in strips from 7 to 17 modules tall, built for narrow spaces like test-tube labels and cable flags, using a finder in one corner and a sub-finder in the opposite one.
- Data Matrix, a different symbology entirely, supports rectangular formats natively and uses an L-shaped solid border instead of corner finders.
The catch is decoder support: every phone camera app reads standard QR; rMQR and rectangular Data Matrix generally need dedicated scanning software. For anything consumers scan, the square symbol wins on compatibility, not geometry.
What squareness does not require
The symbol is square; the artwork need not look it. Modules can be rendered as dots, the code can sit inside a circular badge, and frames can be any shape — as long as the underlying grid, the finder geometry and the quiet zone survive. Where the line falls between styling and breakage is covered in can a QR code be round. Whatever the styling, confirm the result still reads with /validate.
FAQ
Why do QR codes have three squares in the corners?
They are finder patterns. Three known reference points let the decoder recover the code's position, rotation, scale and tilt from a photo, and the deliberately empty fourth corner reveals the orientation, so codes scan correctly from any angle.
Are there rectangular QR codes?
Yes — rMQR (rectangular Micro QR, ISO/IEC 23941) comes in strips from 7 to 17 modules tall for narrow spaces. Phone camera apps mostly do not read it yet, so it suits industrial scanners rather than consumer use.
Does a QR code have to be a perfect square?
The module grid does — decoders reconstruct a square lattice from the finder geometry. Printing that stretches the code into a rectangle distorts module spacing and can break scanning, which is why design tools should scale QR codes proportionally only.
Why is one corner of a QR code empty?
Orientation. With finders in only three corners, the pattern matches exactly one rotation, so the decoder knows which way up the symbol is. The empty corner's area is used for data and, in larger versions, an alignment pattern.
Try it — free, no signup
Related
- QR code anatomy — every region of the symbol — A labelled tour of a QR code: finder patterns, separators, timing, alignment, format and version information, the data region and the quiet zone.
- Finder patterns — how a scanner locates a QR code — The three 7×7 corner squares produce a 1:1:3:1:1 dark-light signature on any scan line through their centre, which is what makes QR codes rotation-proof.
- Can a QR code be round? — The symbol must stay a square grid, but the rendering can look round — circular modules, round eyes, circular frames. What works and what breaks scanning.
- Timing patterns — the ruler inside every QR code — The alternating dark-light lines in row 6 and column 6 tell a decoder the module pitch and count, so it can place its sampling grid before reading data.
- rMQR — the rectangular Micro QR code — rMQR (ISO/IEC 23941, 2022) reshapes QR into strips from 7 to 17 modules tall, holding up to 361 characters - ideal geometry, but scanner support is sparse.