This comparison gets overthought. Both QR Code and Data Matrix are excellent 2D barcodes that can encode hundreds of characters in a small square. Both use Reed-Solomon error correction. Both are omnidirectional. The question of which to use usually comes down to a single thing: who is going to scan it? Answer that and the rest follows naturally.
The short answer
If a consumer with a smartphone is scanning it, use the QR Code generator. If it is going on a medical device, a pharmaceutical pack, a circuit board, or a metal component, use the Data Matrix generator. If a regulator has weighed in, use whatever the regulator says. Everything below is the reasoning behind those three rules.
Who can scan each one
This is the most important practical difference, and it has nothing to do with the barcode itself - it is about what the scanning device supports.
QR Code was designed by DENSO WAVE in 1994 for high-speed industrial scanning of automotive parts. It became a consumer technology almost by accident. As of iOS 11 (2017) and Android 8 (2017), every smartphone camera natively decodes QR codes without any additional app. No instruction needed, no download barrier, no friction. This is an extraordinary distribution advantage that Data Matrix simply does not have.
Data Matrix is not natively decoded by the default iOS or Android camera app. A smartphone user who encounters a Data Matrix needs a dedicated scanning app. In industrial and healthcare environments this does not matter - workers carry dedicated 2D imagers from Zebra, Honeywell, or Datalogic that support both formats. But for any consumer-facing use, Data Matrix is effectively off the table unless you want to put "download this app to scan" on your packaging, which you do not.
The rule is simple: if a smartphone is the scanner, use QR Code.
Capacity
Both formats can hold more data than most real-world applications need. The table below compares maximum capacity per ISO/IEC 18004 (QR) and ISO/IEC 16022 (Data Matrix ECC200 - the older ECC000-140 variants are obsolete):
| Data type | QR Code (max, Level L) | Data Matrix (max) |
|---|---|---|
| Numeric digits | 7,089 | 3,116 |
| Alphanumeric chars | 4,296 | 2,335 |
| Binary bytes | 2,953 | 1,556 |
| Module grid range | 21x21 to 177x177 (40 versions) | 10x10 to 144x144 (24 sizes) |
| Rectangular variant | rMQR (non-square, newer) | DMRE (ISO 21471, well-supported) |
QR Code wins on raw capacity by roughly 2x. In practice this rarely matters - a GS1 GTIN plus lot and expiry plus serial number is under 50 characters, a URL is under 100 characters, and both formats handle these in their smallest configurations.
Error correction
QR Code gives you a choice of four levels. According to DENSO WAVE, the levels are:
| Level | Recovery | When to use |
|---|---|---|
| L (Low) | ~7% | Maximum compactness, clean environments |
| M (Medium) | ~15% | Default for most applications |
| Q (Quartile) | ~25% | Outdoor, industrial, high-wear |
| H (High) | ~30% | Logo embedded in center; keep logo under 30% and away from corner finder patterns |
Data Matrix ECC200 has a fixed error correction algorithm delivering roughly 25-30% codeword recovery. The algorithm uses two interleaved correction blocks - damage spread across the symbol is more recoverable than the same number of damaged modules concentrated in one area. This interleaved structure is one reason Data Matrix performs so well in direct part marking (DPM) environments, where laser engraving and dot peening produce distributed, not concentrated, degradation.
For most applications, both formats offer adequate error correction. Data Matrix's fixed High correction is an advantage in harsh industrial environments; QR Code's selectable levels give you more control over the size versus resilience tradeoff.
Physical size: Data Matrix wins decisively
This is where Data Matrix genuinely pulls ahead. QR Code's minimum version (Version 1) is 21x21 modules, and the required 4-module quiet zone on all sides makes the minimum footprint 29x29 modules. For even the shortest payload, you cannot go smaller.
Data Matrix requires only 1 module of quiet zone (2-4 recommended). For a short serial number or component identifier, a 10x10 Data Matrix with 2-module margins needs a 14x14-module footprint - less than a quarter of QR Code's minimum.
In direct part marking applications - laser engraving on aerospace fasteners, dot peening on automotive components, chemical etching on electronics - Data Matrix symbols as small as 2x2 mm are routinely read by industrial vision systems. QR Code at that scale is not viable. Industry standards like SAE AS9132 mandate Data Matrix for aerospace part marking precisely because of this density advantage.
Practical rule of thumb: if your label area is smaller than 5x5 mm, use Data Matrix. QR Code is generally not practical below about 10x10 mm in most printing and marking scenarios.
Regulatory requirements: there is often no choice
In several major industries, the format is mandated. This is the most important section for anyone working in healthcare, pharmaceuticals, or regulated manufacturing.
Data Matrix is required for:
- FDA UDI (Unique Device Identification): The FDA's UDI system requires Class II and Class III medical devices to carry a unique device identifier. GS1's UDI guidelines and HIBCC both specify GS1 DataMatrix as the required 2D format.
- EU Falsified Medicines Directive (FMD): EU Delegated Regulation 2016/161 mandates Data Matrix on prescription medicine packs for the European Medicines Verification System.
- US DSCSA (Drug Supply Chain Security Act): The FDA's DSCSA framework specifies GS1 DataMatrix as the required 2D barcode on pharmaceutical packaging.
- Aerospace AS9132: Direct part marking on aircraft components requires Data Matrix per SAE AS9132.
QR Code is required or strongly preferred for:
- Swiss QR Code: Swiss financial regulation mandates the Swiss QR format on all Swiss payment slips since 2022. It replaced the old ISR/ESR paper slip entirely.
- Consumer mobile payment ecosystems: WeChat Pay, Alipay, UPI (India), PayNow (Singapore), and Brazil's Pix are all QR-only. Data Matrix is simply not part of these systems.
- GS1 Digital Link (retail, post-2027): GS1's Digital Link standard and the "sunrise 2027" initiative introduce 2D codes at retail point of sale to supplement and eventually replace linear EAN/UPC. Both QR and Data Matrix are technically approved, but QR is the preferred format for consumer-facing packaging where smartphone scanning is expected.
Scanner support at a glance
| Scanner type | QR Code | Data Matrix |
|---|---|---|
| iPhone / iOS camera (iOS 11+) | Native, no app needed | Not native; requires app |
| Android camera (Android 8+) | Native, no app needed | Not native; requires app |
| Dedicated 2D imager (Zebra, Honeywell, Datalogic) | Yes | Yes |
| Laser scanner (1D only) | No | No |
| Fixed industrial vision system | Yes | Yes |
The decision framework
Use QR Code when:
- Consumers or the general public will scan it with a smartphone - this is the non-negotiable case for QR
- The payload is a URL, payment link, contact card, or WiFi credential
- You want to embed a logo (use Level H, cover under 30%)
- The code will appear on screen (signage, digital menus, presentations)
- Swiss payment invoice, WeChat Pay, or a QR-specific payment ecosystem
- New retail packaging following GS1 Digital Link
Use Data Matrix when:
- FDA UDI, EU FMD, DSCSA, or AS9132 compliance is required - if any of these apply, you have no choice
- The label area is under about 5x5 mm
- The code will be directly marked (laser, dot peen, chemical etch) on a metal or plastic component
- The scanning environment is industrial: dedicated imagers, possible surface degradation, no smartphones
- GS1 AI string for pharmaceutical or medical device supply chain (GTIN + lot + expiry + serial)
When either works: Internal warehouse and inventory management with modern 2D imagers can use either. If there is any chance staff might scan with a phone as a backup, lean toward QR. Otherwise, either is fine and you should pick whatever matches your existing infrastructure.
A word on the variants
Micro QR Code (M1-M4, 11x11 to 17x17 modules) closes some of the size gap for very short payloads - up to 35 numeric digits in the smallest configuration. It requires QR-compatible decoding but is supported on most modern imagers. GS1 DataMatrix is Data Matrix with GS1 Application Identifiers encoded in the standard GS1 format, and is the supply chain standard for healthcare and pharmaceutical labeling. GS1 Digital Link QR Code encodes a URL-based GS1 identifier that works simultaneously as a supply chain code and a consumer-facing link - the most promising format for brands that need to serve both industrial scanners and consumer smartphones from a single symbol.