QR Code Basics

How QR Codes Work

QR ("Quick Response") codes were developed in 1994 by Masahiro Hara at Denso Wave, a subsidiary of Toyota, to track automotive parts through manufacturing faster than the linear barcodes used at the time. The two-dimensional design was the key breakthrough: a standard barcode only encodes data along one axis, while a QR code encodes it across both height and width, which is why a QR code can hold roughly 100 times more data than a barcode in the same physical footprint.

The anatomy of a QR code

Every QR code is built from a grid of black and white squares called modules. The arrangement isn't arbitrary — several fixed structural elements let a scanner find, orient, and read the code reliably from almost any angle:

  • Finder patterns. Three identical nested squares sit in the top-left, top-right, and bottom-left corners. These are what a scanner locates first — their fixed 1:1:3:1:1 ratio of black-to-white stripes is recognizable at any scale or rotation, which is how your phone camera identifies "there is a QR code here" before it even starts reading data.
  • Alignment patterns. Smaller square markers scattered through the grid (present in all versions except the smallest) that let the scanner correct for warping — a code printed on a curved surface or photographed at an angle.
  • Timing patterns. Alternating black-and-white lines connecting the finder patterns, used to help the scanner determine the exact width of each module so it can read the grid accurately even at low resolution.
  • Quiet zone. A border of blank space, at least four modules wide, required around the entire code. Without it, a scanner can't reliably distinguish where the code starts against a busy background — this is the single most common reason a QR code fails to scan even though the grid itself is intact.
  • Data and error correction area. The remaining modules, which store the actual encoded content along with redundant error correction data (covered in detail in our error correction guide).

Encoding modes

A QR code doesn't store text the same way regardless of content — it selects an encoding mode based on the character set involved, because each mode packs data at a different density:

  • Numeric mode encodes digits 0-9 only, at roughly 3.3 bits per digit — the most efficient mode, used for things like numeric IDs or phone numbers.
  • Alphanumeric mode handles digits, uppercase letters, and a small set of symbols (space, $, %, *, +, -, ., /, :), at about 5.5 bits per character.
  • Byte mode encodes raw 8-bit byte values, which covers full UTF-8 text including lowercase letters, punctuation, and most URLs — the most common mode for general-purpose QR codes, at 8 bits per character.
  • Kanji mode is a specialized mode for double-byte Shift JIS characters, packing Japanese kanji at 13 bits per character — more efficient than encoding the same characters in byte mode.

Some QR code generators support mixing modes within a single code — using numeric mode for a digit-heavy segment and byte mode for the rest — to reduce total module count for a given payload.

Versions and capacity

"Version" in the QR code spec refers to the size of the grid, not a revision number. There are 40 versions, from Version 1 (a 21x21 module grid) up to Version 40 (177x177 modules), with each version adding 4 modules per side. A QR code generator picks the smallest version that fits the data you're encoding at your chosen error correction level — which is why the same URL can produce a visibly smaller or larger code depending on which correction level you select.

At the low end, Version 1 with the lowest error correction can hold about 41 numeric characters or 17 bytes of text. At the high end, Version 40 with the lowest error correction can hold up to about 7,089 numeric characters or 2,953 bytes — though in practice, codes that dense become difficult to scan reliably at normal print sizes, since each module becomes proportionally tiny.