Skip to content

Data Matrix vs QR Code: Same Data, Measured Side by Side

We encoded the same text as a Data Matrix and as a QR code and measured both. Short data is much smaller as a Data Matrix; very long data can be smaller as a QR code. Try your own text below.

Data Matrix or QR code: the short answer

Pick a Data Matrix when a machine reads the code, the space is small, or a rule names it: parts and electronics, healthcare packs (GS1 DataMatrix) and EU prescription medicines. Pick a QR code when a person scans it with a phone camera, when it must open a web page, or when you want to choose the error correction level.

The sections below put numbers on that, measured on the same data.

Try it: your text as a Data Matrix and as a QR code

Type your data. Both codes are drawn at the same module scale, each with the quiet zone its standard asks for (1 module for a Data Matrix, 4 for a QR code), so you see their real relative size. The printed size follows the module size and printer resolution you pick. Everything runs in your browser; nothing is uploaded.

Data Matrix code
Data Matrix16 × 16 modules, 18 × 18 with its quiet zone4.6 × 4.6 mm at 0.254 mm modules and 300 dpi (3 dots per module)
QR code
QR code21 × 21 modules, 29 × 29 with its quiet zone7.4 × 7.4 mm at 0.254 mm modules and 300 dpi (3 dots per module)

With quiet zones, the QR Code (level M) takes 2.6 times the area of the Data Matrix.

How big is the same data in each code?

We encoded each sample with the encoders behind this site: the smallest square Data Matrix (ECC 200), and a QR code at error correction levels L, M and H. Sizes are modules per side, without the quiet zone.

How big is the same data in each code?
DataData MatrixQR level LQR level MQR level H
12-digit number 12345678901214 × 1421 × 2121 × 2121 × 21
Part number PN-48213-A716 × 1621 × 2121 × 2125 × 25
Serial SN-2026-00012316 × 1621 × 2121 × 2125 × 25
Web address https://data-matrix-generator.com22 × 2229 × 2929 × 2933 × 33
GS1 element string (01)…(21)1234522 × 2225 × 2525 × 2529 × 29

A square Data Matrix starts at 10 × 10 modules and a QR code at 21 × 21, so short data gives the biggest gap: the 12-digit number is 14 × 14 as a Data Matrix and 21 × 21 as a QR code. A higher QR level makes the code bigger: the web address goes from 29 × 29 at level L to 33 × 33 at level H. The last row is a GS1 element string: GS1 DataMatrix and GS1 QR Code both start with FNC1; see the GS1 Data Matrix generator.

How small can each code be printed?

GS1 gives 0.254 mm as the smallest module for regulated healthcare items (Table 5-52). At 300 dpi that is exactly 3 printer dots per module; at 203 dpi the nearest is 2 dots (0.25 mm) and at 600 dpi it is 6 dots. The sizes below use that module, the quiet zones of Table 5-46 (1 module for a Data Matrix, 4 for a QR code) and QR level M.

How small can each code be printed?
DataData Matrix, square sideQR code, square sideQR code area compared with Data Matrix
12-digit number 1234567890124.1 mm7.4 mm3.3×
Part number PN-48213-A74.6 mm7.4 mm2.6×
Serial SN-2026-0001234.6 mm7.4 mm2.6×
Web address https://data-matrix-generator.com6.1 mm9.4 mm2.4×
GS1 element string (01)…(21)123456.1 mm8.4 mm1.9×

So the 12-digit number needs a 4.1 mm square as a Data Matrix and 7.4 mm as a QR code, quiet zone included. 0.254 mm is a floor for good printers and verifiers, not a comfortable size: for phones and cheap scanners use bigger modules (GS1 gives 0.495 mm as the target for retail packs). The Data Matrix generator rounds a module to whole printer dots and shows the size you get.

Source: GS1 General Specifications, Release 26.0, section 5.6.

When is a QR code the smaller one?

For long data, sometimes. A Data Matrix spends a fixed, fairly large share of its symbol on error correction, while QR level L spends little. We encoded mixed-case text of growing length and compared the area with quiet zones:

When is a QR code the smaller one?
CharactersData MatrixQR level LQR level MSmallest with quiet zones
2018 × 1825 × 2525 × 25Data Matrix
5032 × 3229 × 2933 × 33Data Matrix
10040 × 4037 × 3741 × 41Data Matrix
20052 × 5253 × 5357 × 57Data Matrix
50080 × 8077 × 7785 × 85Data Matrix
1000120 × 120105 × 105121 × 121QR level L

The Data Matrix is smallest up to 500 characters here. At 1000 characters QR level L is smaller (105 × 105 against 120 × 120), but it has the least error correction. Against QR level M, the usual default of QR generators, the Data Matrix is smaller or about equal in every row.

How much data fits?

A QR code holds more, about twice as much: a version 40 QR code at level L against the largest square Data Matrix, 144 × 144 modules.

How much data fits?
Kind of dataData Matrix (144 × 144)QR code (version 40, level L)
Digits only3,1167,089
Capital letters and digits2,3354,296
Any bytes (lower case, URLs)1,5562,953

We checked every limit with the encoder: it takes exactly that much and refuses one more. Most labels hold a part number, a serial and a date, a tiny fraction of either limit.

Error correction: fixed in a Data Matrix, your choice in a QR code

A Data Matrix has no level to choose: the amount of error correction is fixed for each size (the table on the home page lists it). A QR code has four levels, L, M, Q and H, which can restore roughly 7%, 15%, 25% and 30% of the symbol (ISO/IEC 18004). More correction costs size, as the table above shows. The two are not directly comparable: a larger Data Matrix gets more room for correction, a QR code gets more only if you ask for it.

Who can scan it?

Most phone camera apps open QR codes without extra software. Many do not read Data Matrix, so test with the phones your users have, or tell them which app to use. Industrial scanners and imagers usually read both. Either code can hold a web address that redirects wherever you point it later (a GS1 Digital Link works this way). In practice QR codes are the ones people open as links, while a Data Matrix mostly carries the data itself, and data printed in a code cannot be changed without reprinting.

Rules that name one of them

In the EU, prescription medicines (except those listed in Annex I) and the few non-prescription ones listed in Annex II must carry a Data Matrix. The Commission’s regulation lists what goes in it (product code, serial number of up to 20 characters, batch, expiry date, and a national number where a country requires one) and says that a print quality of at least 1.5 under ISO/IEC 15415 is presumed to comply.

US device labels work differently: 21 CFR 801.40, Form of a unique device identifier asks for the UDI in plain text and in “Automatic identification and data capture (AIDC) technology” and does not name a symbology; the issuing agency’s rules do. For GS1 on healthcare items the usual choice is the GS1 DataMatrix: see the GS1 Data Matrix generator. Check the rule that applies to your product and market before you choose.

The barcode shall be a machine-readable Data Matrix and have error detection and correction equivalent to or higher than those of the Data Matrix ECC200.

— Delegated Regulation (EU) 2016/161, Article 5(2)

Source: Commission Delegated Regulation (EU) 2016/161, Articles 4 to 6.

Make your Data Matrix

This site makes Data Matrix codes, not QR codes; the QR codes on this page are there for the comparison. Plain text, numbers and URLs: the Data Matrix generator. Product data with GTIN, expiry and batch: the GS1 Data Matrix generator. A list on label sheets: Data Matrix labels.

FAQ

GS1 is a registered trademark of GS1 AISBL. Avery is a registered trademark of Avery Products Corporation. This site is not affiliated with either.