Back to All Blog Posts
Barcode Guides

Data Matrix vs QR Code: The Differences and Which One to Use

By 4 min read
A Data Matrix code next to a QR code
Short answer

Use a QR code when people will scan it with their phones: links, menus, payments, Wi-Fi, marketing. Use Data Matrix for small industrial and regulated marking: medicine packs (GS1 DataMatrix), electronic parts, and items marked directly on metal or plastic. Data Matrix fits more data into a smaller square and needs only a one-module margin; QR codes are recognised instantly by every phone camera and hold more data at their largest size.

From a distance they look like cousins: black and white squares in a grid. Look closer and the differences show up. A QR code has three large squares in its corners. A Data Matrix has an L-shaped solid border on two sides and a dotted pattern on the other two. Those features tell the scanner how the code is positioned, and they also hint at what each was designed for.

Side by side

QR codeData Matrix (ECC 200)
Recognise it byThree large squares in the cornersSolid L-shaped border and a dotted edge
Largest capacity7,089 digits or 2,953 bytes3,116 digits or 1,556 bytes
Error correctionChoose L, M, Q or H (about 7 to 30%)Fixed Reed-Solomon correction
Blank margin needed4 modules1 module
Size for small amounts of dataLargerVery compact, can be a few millimetres
Phone camerasRead by the built-in camera appUsually needs a scanner app
Typical useConsumer: links, payments, menus, ticketsIndustry: medicines, parts, electronics, postage

Where Data Matrix wins

  • Very small spaces. A serial number on a circuit board, a surgical instrument or a tiny vial. Data Matrix stays readable at sizes where a QR code wouldn’t fit its quiet zone.
  • Direct part marking. Laser-etched or dot-peened onto metal and plastic, where it has to survive scratches, oil and heat.
  • Medicines. GS1 DataMatrix carries the product number, serial number, batch and expiry date on packs in many countries’ anti-counterfeiting and traceability systems.
  • Postage and logistics. Postal services print it on labels and stamps because it’s compact and reliable.

Where QR wins

  • Anything aimed at the public. Every modern phone camera recognises a QR code without an app. That’s decisive for marketing, menus, payments and tickets.
  • Large amounts of data, such as a full vCard or a long Wi-Fi password.
  • Design freedom. With high error correction, a QR code can carry a small logo and brand colours and still scan. Here’s how far you can push it.

GS1 Sunrise 2027

GS1, the organisation that manages product barcodes, has set a target known as Sunrise 2027: by the end of 2027, retail checkout scanners should be able to read 2D barcodes as well as the familiar EAN and UPC stripes. Both QR codes with GS1 data (GS1 Digital Link) and GS1 DataMatrix are part of it. The idea is that one code on a pack can serve the checkout, carry batch and expiry details for stock control and recalls, and link shoppers to product information. Linear EAN and UPC barcodes aren’t disappearing overnight; for now, many products carry both.

Which should you use?

Your situationUse
Customers will scan it with a phoneQR code
Medicine or healthcare packaging with GS1 dataGS1 DataMatrix
Marking small parts or tools for your own trackingData Matrix
A retail product’s checkout code todayEAN-13 or UPC-A (from GS1)
Shipping labels with batch and expiryGS1-128

Test before you print

Whichever you choose, print a sample at the real size and scan it with the device that will actually be used: a warehouse scanner for Data Matrix, two or three different phones for QR codes. The Barcode Reader reads both from a camera or an image file.

Frequently asked questions

What is the difference between Data Matrix and QR code?

QR codes are designed for phone scanning by the public and hold more data. Data Matrix is more compact, needs a smaller margin and is used for industrial and medicine marking.

Can a phone read a Data Matrix code?

Most phones can with a barcode scanner app. The built-in camera app usually recognises only QR codes.

Which holds more data, QR or Data Matrix?

At their largest sizes, QR codes hold more: up to 7,089 digits, compared with 3,116 for Data Matrix. For small amounts of data, Data Matrix is smaller.

Why do medicines use Data Matrix?

GS1 DataMatrix stores the product code, serial number, batch and expiry in a tiny square, which supports traceability and anti-counterfeiting rules.

What is GS1 Sunrise 2027?

An industry target for retail point-of-sale scanners to read 2D barcodes, such as QR codes with GS1 data and GS1 DataMatrix, by the end of 2027.

Create a Data Matrix code

Plain text or GS1 DataMatrix with GTIN, serial, batch and expiry. Download as vector.

Open Data Matrix Generator
Akhtar Ali

Founder of CleanPDF. I build the site’s browser-based PDF, image, QR code and calculator tools, and I write these guides around the questions people send in while using them.