Data Matrix vs. QR Code: Size, Error Correction and GS1 Use

Should I use a Data Matrix or a QR code, and what is the practical difference?

Short answer

Data Matrix fits the same data into a smaller symbol and needs only a one-module margin, so it suits tiny items, marks etched or peened onto parts, and healthcare packaging, where GS1 lists GS1 DataMatrix as a preferred option. QR Code is larger for the same data but lets you choose its error correction level, and phone cameras such as the iPhone's open QR links directly. Plain Barcode makes QR codes but not Data Matrix.

On this page
  1. Side-by-side comparison
  2. Size: why Data Matrix fits where QR won't
  3. Error correction: chosen or built in
  4. GS1 data inside: element strings or a web address
  5. Healthcare, drugs and medical devices
  6. Links for customers: QR's home ground
  7. Bottom line

Both are 2D matrix codes built from small square modules, and a camera-based 2D scanner can read either one. The differences that matter show up in four places: how small you can print them, how they cope with damage, how GS1 data goes inside, and who expects to scan them.

One thing to know up front: Plain Barcode's QR code generator makes QR codes, but neither it nor the barcode generator makes Data Matrix. If your job calls for Data Matrix, you'll need label or marking software that supports it.

Side-by-side comparison

Data Matrix is defined in ISO/IEC 16022 and QR Code in ISO/IEC 18004. The figures below come from the GS1 General Specifications (sections 5.6 and 5.7), which cover the ECC 200 version of Data Matrix, the only one that supports GS1 data.

Data Matrix (ECC 200)QR Code
Finder patternSolid L-shaped border on two sidesThree square marks in the corners
ShapesSquare or rectangularSquare only
Sizes10 × 10 to 144 × 144 modules; rectangles from 8 × 18 to 16 × 4821 × 21 to 177 × 177 modules (versions 1 to 40)
Quiet zone1 module on each side4 modules on each side
Largest capacity3,116 digits or 1,556 bytes7,089 digits or 2,953 bytes (at level L)
Error correctionReed-Solomon, fixed by symbol sizeReed-Solomon, four levels you choose
Typical jobsHealthcare labels, small parts, direct part markingLinks for customers, signs, tickets

QR holds more at its largest, but most labels carry far less than either maximum. For everyday data, the more useful difference is footprint.

Size: why Data Matrix fits where QR won't

Data Matrix starts smaller (10 × 10 versus 21 × 21 modules) and needs a quarter of the margin. For short data, that adds up quickly.

Take the GS1 element string (01)09506000134352, a GTIN with its Application Identifier: 16 digits plus an FNC1 character that marks it as GS1 data.

  1. Data Matrix: GS1 counts FNC1 as one codeword and each pair of digits as one codeword, so this needs 9 data codewords. A 14 × 14 symbol holds 8; the next size, 16 × 16, holds 12. Add the 1-module quiet zone and the footprint is 18 × 18 modules.
  2. QR Code: DENSO WAVE's capacity table shows Version 1 (21 × 21) holding up to 34 digits at level M, so the data fits with room to spare. Add the 4-module quiet zone and the footprint is 29 × 29 modules.
  3. Printed size: at a module size of 0.495 mm, GS1's target X-dimension for 2D codes on retail packaging, the Data Matrix needs about 8.9 mm square and the QR code about 14.4 mm square. The Data Matrix uses less than half the area.

GS1 lists direct part marking by dot peening or laser etching, high-speed inkjet coding, and very small items among the uses of GS1 DataMatrix. GS1's direct marking table allows both GS1 DataMatrix and GS1 QR Code on parts in general, but only GS1 DataMatrix for marks made directly on medical devices.

Error correction: chosen or built in

QR Code lets you pick one of four Reed-Solomon levels. GS1 lists their recovery capacity as about 7% of the codewords for L, 15% for M, 25% for Q and 30% for H. A higher level makes the symbol larger for the same data. DENSO WAVE's error correction page says M is the level chosen most often, with Q or H suited to dirty factory settings. The QR size and error correction guide covers that trade-off in print.

Data Matrix ECC 200 also uses Reed-Solomon, but you don't choose a level. Each symbol size comes with a fixed amount, and GS1's size table shows error correction taking 62.5% of the codewords in the smallest symbol and roughly 28% in the largest sizes. Those overhead figures aren't directly comparable with QR's recovery percentages, but the point holds: with Data Matrix, protection comes with the size.

Both can also be read as light marks on a dark background, which matters for some laser-etched parts.

GS1 data inside: element strings or a web address

There are two ways to put GS1 data in either symbol:

  • Element strings. GS1 DataMatrix and GS1 QR Code start with FNC1 and carry Application Identifiers such as (01) GTIN, (17) expiration date and (10) lot, the same syntax GS1-128 uses.
  • A GS1 Digital Link URI. Plain Data Matrix or QR Code holds a web address with the GTIN in its path, so a phone can open it and a scanner can pull out the GTIN. GS1 US notes on its barcode types page that GS1 DataMatrix doesn't support Digital Link, while plain Data Matrix can carry it.

At retail checkout, the General Specifications name three conformant 2D options for general retail items: GS1 DataMatrix, QR Code with a Digital Link URI, and Data Matrix with a Digital Link URI. For now they're printed in addition to the UPC or EAN, not instead of it. The QR code vs. barcode guide covers that transition.

Either way, GS1 says these symbols need 2D imaging scanners; most scanners that aren't imagers can't read them. Check your hardware before you switch an internal label from a linear code.

Healthcare, drugs and medical devices

For healthcare primary packaging, GS1 names GS1 DataMatrix among the preferred carriers and favors it because it fits all the data in one symbol. U.S. rules point the same way for drugs:

  • Prescription drugs. Under federal law (21 U.S.C. 360eee-1), the product identifier on a drug package goes in a 2D data matrix barcode, and on a homogeneous case in a linear or 2D data matrix barcode, unless FDA allows other technologies through guidance. The FDA describes this Drug Supply Chain Security Act system as a way to trace certain prescription drugs at the package level.
  • Medical devices. The FDA's UDI Basics page says labelers must show the unique device identifier in plain text and in an automatic identification and data capture (AIDC) form, developed under the system of an FDA-accredited issuing agency. The page doesn't prescribe one barcode type, and UDI formats differ by issuing agency.

This is general information, not legal or regulatory advice. Confirm the exact requirements for your product with the regulator, your issuing agency and your customers.

When the person scanning is a shopper with a phone, QR Code is the safer choice. Apple's iPhone guide explains scanning QR codes for websites, apps, coupons and tickets straight from the Camera app. Data Matrix can carry a web address too, as GS1 US notes, but test it on the phones your customers actually use before you rely on it.

The site's QR code generator makes link, Wi-Fi, email, phone, SMS and text codes, with error correction levels L, M, Q and H and a module size you set in millimeters.

Bottom line

Choose Data Matrix when space is tight, the mark goes directly on a part, or a healthcare customer or regulation calls for GS1 DataMatrix, and make it with software that supports GS1 DataMatrix. Choose QR Code when customers will scan it with a phone, and make it with the QR code generator. For a checkout-ready 2D code, use one of GS1's three retail options and keep your UPC. If you're still matching codes to jobs, the barcode type decision guide walks through the rest.

Sources

  1. GS1: GS1 General Specifications Standard (Release 26.0)
  2. ISO: ISO/IEC 16022:2024 Information technology — Automatic identification and data capture techniques — Data Matrix bar code symbology specification
  3. ISO: ISO/IEC 18004:2024 Information technology — Automatic identification and data capture techniques — QR code bar code symbology specification
  4. DENSO WAVE: Information capacity and versions of QR Code
  5. DENSO WAVE: Error correction feature
  6. GS1 US: Types of Barcodes
  7. Legal Information Institute, Cornell Law School: 21 U.S. Code § 360eee-1 - Requirements
  8. U.S. Food and Drug Administration: Drug Supply Chain Security Act (DSCSA)
  9. U.S. Food and Drug Administration: UDI Basics
  10. Apple: Scan a QR code with your iPhone camera

Written by Toma Tomov, editor of Plain Barcode.

How guides are researched and corrected: Editorial Policy. Spotted an error? Email tomov@gmx.com.