Published Jul 12, 2026
# What Is a QR Code?
A QR code (Quick Response code) is a two-dimensional matrix barcode: a square grid of black and white modules that encodes data in both directions at once. Defined by the ISO/IEC 18004 standard, it can hold anything from a phone number to a 2,000+ byte payload, and any smartphone camera can read it without a dedicated app.
Anatomy: the parts inside the grid
Unlike a one-dimensional barcode, which a reader sweeps across in a single line, a QR code is captured as one image and read all at once. Fixed patterns let the camera orient itself before decoding. According to the ISO/IEC 18004 specification and Wikipedia, the grid contains these components:
| Component | Position | Role |
|---|---|---|
| Finder pattern | Three 7×7 squares in the top-left, top-right and bottom-left corners | The camera locks onto them to find the symbol and its orientation |
| Timing pattern | Row and column 6, between the finders | Alternating modules that set the grid spacing |
| Alignment pattern | One 5×5 grid in versions 2-6, five in versions 7-40 | Keeps decoding accurate when the symbol is rotated or skewed |
| Format information | 15 bits around each finder | Tells the reader the error-correction level and mask pattern |
| Version information | Two small blocks, versions 7 and up | 18 bits identifying which of the 40 versions is in use |
| Data modules | All remaining cells | The payload itself, protected by Reed-Solomon error correction |
| Quiet zone | Border outside the grid | A four-module margin, required by ISO/IEC 18004 |
Forty versions, one formula
The symbol comes in 40 versions. Version 1 is a 21×21 grid; each step adds four modules per side, so version v measures 4v + 17 modules, up to 177×177 at version 40. Bigger versions hold more data but need more print space, which is why choosing the smallest version that fits your payload matters (see minimum QR code size).
| Version | Grid | Byte capacity L / M / Q / H |
|---|---|---|
| 1 | 21×21 | 17 / 14 / 11 / 7 |
| 5 | 37×37 | 106 / 84 / 60 / 44 |
| 10 | 57×57 | 271 / 213 / 151 / 119 |
| 20 | 97×97 | 858 / 666 / 482 / 382 |
| 40 | 177×177 | 2953 / 2331 / 1663 / 1273 |
These byte-mode values come from ISO/IEC 18004 and we re-verified them by generating every version in our tool. In that same run, a five-character text payload fit in version 1 at every error level, while a 245-byte vCard jumped to version 11 at level M and version 16 at level H — 33% more modules for the identical data. The complete numeric and alphanumeric matrix for versions 1-10 is on the QR code capacity page.
Four ways to encode the same data
ISO/IEC 18004 defines four encoding modes, and a smart encoder picks the densest one automatically:
- Numeric (0-9): three digits per 10 bits — a 12-digit order number uses about 60% fewer bits than the same digits stored as text.
- Alphanumeric (0-9, A-Z, space and a few symbols): two characters per 11 bits.
- Byte: one byte per 8 bits; this is what URLs and most real-world content use.
- Kanji: one Shift-JIS character per 8 bits, designed for Japanese labels.
Mixed content is allowed: the encoder splits the payload into segments and writes each part in its best mode. That is exactly what the QR code generator does under the hood.
What a QR code can store
The payload is just a string, so the "type" of code is decided by its format:
| Content type | Payload format | Where to generate it |
|---|---|---|
| Web address | https://example.com/page | URL QR |
| WiFi network | WIFI:T:WPA;S:MyNet;P:Secret123;; | WiFi QR |
| Contact card | BEGIN:VCARD … END:VCARD | vCard QR |
| Bank transfer | BCDC + ISO 20022 fields | SEPA QR |
| Phone, SMS, email, event, location | tel: / sms: / mailto: / BEGIN:VEVENT / geo: | Any type in the QR generator |
QR code vs one-dimensional barcode
QR codes and 1D barcodes (Code 128, EAN-13, UPC-A) solve the same problem — machine-readable data — with very different geometry. The table below compresses the comparison to twelve dimensions; the full analysis with a buying guide is on QR code vs barcode.
| # | Dimension | QR code | 1D barcode |
|---|---|---|---|
| 1 | Encoding | 2D matrix, reads horizontally and vertically | Bars in one direction |
| 2 | Max payload | 2,953 bytes (version 40, level L) | about 48 characters (Code 128) |
| 3 | Orientation | Scannable at any rotation | Must be aligned left to right |
| 4 | Error correction | 7-30% recovery, four levels | None built in |
| 5 | Data types | URLs, vCards, WiFi, email, numbers | Mostly digits and letters |
| 6 | Human readability | No readable text | Many symbologies print readable digits |
| 7 | Scanner needed | Any phone camera | Dedicated laser/CCD scanner or app |
| 8 | Print size for the same data | Larger — more modules per byte | More compact per character |
| 9 | Standard | ISO/IEC 18004 | Per symbology (ISO/IEC 15417, GS1 standards) |
| 10 | Typical job | Payments, marketing, logistics labels | Retail point of sale, shipping |
| 11 | Damage tolerance | Recovers from scratches and occlusion | Fails when a single bar is damaged |
| 12 | Origin | 1994, DENSO WAVE, Japan | 1974, first retail barcode in the US |
How scanning actually works
- A camera — built-in or the online QR scanner — captures the symbol.
- Detection finds the three finder patterns and estimates rotation and perspective.
- Decoding reads the grid, reverses the mask, and Reed-Solomon correction repairs any damaged modules.
A healthy code decodes in well under a second on a recent phone. For codes that must survive outdoors, curved surfaces or logos on top, generate at error-correction level H and use the QR beautifier to keep the design clean while the correction level does the heavy lifting. If you have hundreds of codes to produce at once, the batch QR generator runs the same encoders row by row.
How long does a QR code last?
A static QR code has no expiry: the data is printed into the modules, so the code outlives any service. A dynamic QR code points at a short link managed by a provider and lasts as long as that service runs. If the destination will change later — a new landing page, a rotated WiFi password — dynamic is the right choice; for anything fixed for life, static is free and permanent.