QR Code vs Data Matrix: Which 2D Barcode Should You Actually Use?

A practical comparison of QR Code and Data Matrix barcodes. Capacity, error correction, physical size, regulatory requirements, and the one question that decides it, which is who does the scanning.

This comparison gets overthought. QR Code and Data Matrix both encode hundreds of characters in a small square, both use Reed-Solomon error correction, and both read from any angle. Which one to use comes down to one question. Who is going to scan it? Answer that and the rest follows.

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.

Who can scan each one

The difference is what the scanning device supports.

QR Code was designed by DENSO WAVE in 1994 for high-speed scanning of automotive parts. The built-in camera apps in iOS 11 (2017) and, on most phones, Android 9 and later decode QR codes with no extra app, so there is no download barrier and no instruction needed.

Most default camera apps do not decode Data Matrix (the iOS camera reads only QR codes, and on Android it depends on whether Google Lens is built in), so a smartphone user usually needs a dedicated scanning app. In industrial and healthcare settings that is fine, because workers carry 2D imagers from Zebra, Honeywell or Datalogic that read both formats. For consumer-facing use, Data Matrix is off the table unless you are willing to print "download this app to scan" on your packaging.

The rule is simple. If a smartphone is the scanner, use QR Code.

Capacity

Both formats hold more data than most uses need. The table compares maximum capacity per ISO/IEC 18004 (QR) and ISO/IEC 16022 (Data Matrix ECC200). The older ECC000-140 variants are obsolete.

Data typeQR Code (max, Level L)Data Matrix (max)
Numeric digits7,0893,116
Alphanumeric chars4,2962,335
Binary bytes2,9531,556
Module grid range21x21 to 177x177 (40 versions)10x10 to 144x144 (24 sizes)
Rectangular variantrMQR (non-square)DMRE (ISO/IEC 21471)

QR Code holds roughly twice as much. In practice the difference seldom matters, because a GS1 GTIN plus lot, expiry and serial number is usually under 50 characters, a URL is under 100 characters, and both formats handle those in their smallest configurations.

Error correction

QR Code gives you a choice of four levels, as DENSO WAVE documents.

LevelRecoveryWhen to use
L (Low)About 7%Maximum compactness, clean environments
M (Medium)About 15%Default for most uses
Q (Quartile)About 25%Outdoor, industrial, high-wear
H (High)About 30%Logo in the center. Keep the logo under 30% of the area and away from the corner finder patterns

Data Matrix ECC200 has one fixed algorithm with roughly 25-30% codeword recovery. Symbols of 52x52 modules and up split their codewords across up to ten interleaved correction blocks, so damage spread across the symbol is more recoverable than the same number of damaged modules in one area. That is one reason Data Matrix does so well in direct part marking (DPM), where laser engraving and dot peening produce distributed degradation.

For most uses both are adequate. Data Matrix's fixed high correction is an advantage in harsh industrial environments, and QR Code's selectable levels give you control over the trade-off between size and resilience.

Data Matrix is smaller

QR Code's smallest version (Version 1) is 21x21 modules, and the 4-module quiet zone on all sides makes the minimum footprint 29x29 modules, however short the payload.

Data Matrix needs only 1 module of quiet zone (2-4 recommended). A 10x10 Data Matrix with 2-module margins fits a 14x14-module footprint, less than a quarter of QR Code's minimum.

In direct part marking (laser engraving on aerospace fasteners, dot peening on automotive components, chemical etching on electronics), industrial vision systems routinely read Data Matrix symbols only a few millimeters across. QR Code is not viable at that scale. SAE AS9132 sets the quality requirements for Data Matrix marks on aerospace parts, and US Department of Defense item identification under MIL-STD-130 requires a Data Matrix ECC200 mark.

If your label area is smaller than 5x5 mm, use Data Matrix. QR Code needs about 10x10 mm or more in most printing and marking.

Where the format is mandated

In several industries the format is set by regulation, and the rules below decide the question for anyone in healthcare, pharmaceuticals or regulated manufacturing.

Data Matrix is required or standard for

  • Medical devices under the FDA's UDI system. Every device class must carry a unique device identifier in a machine-readable form, and the FDA does not name a symbology. In practice the 2D carrier is GS1 DataMatrix under GS1's UDI guidelines or HIBC Data Matrix under HIBCC.
  • Prescription medicines in the EU. Delegated Regulation 2016/161 under the Falsified Medicines Directive mandates Data Matrix on packs for the European Medicines Verification System.
  • Pharmaceutical packaging in the US. The FDA's DSCSA framework calls for a 2D Data Matrix barcode, which in practice is GS1 DataMatrix.
  • Defense items. MIL-STD-130 requires a Data Matrix ECC200 mark for US Department of Defense item unique identification, and SAE AS9132 sets the quality requirements for Data Matrix marks on aerospace parts.

QR Code is required or preferred for

  • Swiss payment slips. The QR-bill standard from SIX replaced the paper ISR/ESR slips, which were withdrawn on 30 September 2022.
  • Consumer mobile payments. WeChat Pay, Alipay, UPI (India), PayNow (Singapore) and Brazil's Pix all use QR codes.
  • Retail packaging from 2027. GS1's Digital Link standard and the "sunrise 2027" initiative bring 2D codes to retail point of sale to supplement and eventually replace EAN and UPC. Both QR and Data Matrix are approved, and QR is preferred for consumer-facing packaging where smartphone scanning is expected.

Scanner support at a glance

Scanner typeQR CodeData Matrix
iPhone / iOS camera (iOS 11+)Native, no app neededNot native, needs an app
Android camera (Android 9+, most phones)Native, no app neededNot native on most phones. Google Lens reads it
Dedicated 2D imager (Zebra, Honeywell, Datalogic)YesYes
Laser scanner (1D only)NoNo
Fixed industrial vision systemYesYes

The decision framework

Use QR Code when

  • Consumers or the general public will scan it with a smartphone. This alone decides it.
  • The payload is a URL, payment link, contact card or WiFi credential.
  • You want to embed a logo (use Level H and cover under 30%).
  • The code will appear on screen (signage, digital menus, presentations).
  • It is a Swiss payment invoice, WeChat Pay, or another QR-specific payment scheme.
  • It is new retail packaging following GS1 Digital Link.

Use Data Matrix when

  • EU FMD, DSCSA or MIL-STD-130 applies, or the label follows GS1 or HIBCC UDI guidance. For the first three you have no choice.
  • The label area is under about 5x5 mm.
  • The code will be marked directly (laser, dot peen, chemical etch) on a metal or plastic component.
  • The scanning environment is industrial, with dedicated imagers, possible surface degradation, and no smartphones.
  • It carries a GS1 AI string for a pharmaceutical or medical device supply chain (GTIN plus lot, expiry and serial).

When either works

Internal warehouse and inventory systems with modern 2D imagers can use either. If staff might scan with a phone as a backup, lean toward QR. Otherwise pick whichever matches your existing infrastructure.

The variants

Micro QR Code (M1-M4, 11x11 to 17x17 modules) closes some of the size gap for very short payloads, from 5 numeric digits in M1 up to 35 in M4. It needs QR-compatible decoding and is supported on most modern imagers. GS1 DataMatrix is Data Matrix with GS1 Application Identifiers 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 as a supply chain code and a consumer-facing link at the same time, which makes it the one format that serves industrial scanners and consumer smartphones from a single symbol.

Try it

More guides