Barcodes
Data Matrix vs QR code: which 2D symbology for your label
Real module counts for the same payload in both symbologies, why Data Matrix wins on a 5 mm part, why QR wins on anything a phone scans, and a decision table.
The part is 5 mm across, the label has to carry a serial number, and the QR code you generated is 15 mm square before the quiet zone. That is the situation where the symbology choice stops being a preference and becomes arithmetic.
Both are 2D matrix codes, both use Reed–Solomon error correction, both survive being photographed at an angle. They diverge on how much area they need and on who is holding the reader.
The same data, side by side
These are real module counts, encoded with default settings in both symbologies. Data Matrix picks its own size; the QR figures are given at level M and level H, because the level is the thing you choose.
| Payload | Data Matrix | QR at M | QR at H |
|---|---|---|---|
12345678 | 12 × 12 | 21 × 21 (v1) | 21 × 21 (v1) |
SN-4471-A093 | 16 × 16 | 21 × 21 (v1) | 25 × 25 (v2) |
0123456789012345678 | 16 × 16 | 21 × 21 (v1) | 25 × 25 (v2) |
https://example.com | 18 × 18 | 25 × 25 (v2) | 29 × 29 (v3) |
https://shop.example/p/12345 | 22 × 22 | 29 × 29 (v3) | 33 × 33 (v4) |
| GS1 string: GTIN, expiry, batch | 20 × 20 | 29 × 29 (v3) | 33 × 33 (v4) |
Then add the quiet zone, which is where the gap widens sharply. Data Matrix needs one module on each side; QR needs four. At a 0.5 mm module:
| Payload | Data Matrix footprint | QR (M) footprint | Area ratio |
|---|---|---|---|
12345678 | 14 modules — 7.0 mm | 29 modules — 14.5 mm | 23% |
https://example.com | 20 modules — 10.0 mm | 33 modules — 16.5 mm | 37% |
| GS1 string | 22 modules — 11.0 mm | 37 modules — 18.5 mm | 35% |
A Data Matrix carrying the same content occupies roughly a third of the area, and less than a quarter for short serial numbers. On a component label that is the whole argument.
Where the area goes: finder patterns
QR’s three corner squares are expensive. Each finder is 7 × 7 modules plus a one-module separator, so 8 × 8 = 64 modules, three times over: 192 modules of fixed overhead. Add the format information (31 modules) and the timing patterns, and a version 1 symbol spends about 233 of its 441 modules — over half — before a single bit of your data is encoded.
Data Matrix uses a solid L along two edges to locate and orient the symbol, and an alternating light–dark clock track along the other two to tell the reader how many modules there are. That is the perimeter and nothing more: 44 modules of a 12 × 12 symbol’s 144, about 31%.
The trade is real, not free. QR’s three corners give a reader a fast, rotation- independent lock from a distance and at an angle, which is precisely what a hand-held phone needs. Data Matrix’s clock track is cheaper but demands a cleaner image of the whole perimeter — which is why a Data Matrix distorted along one axis stops decoding faster than a QR code does.
Error correction: one fixed scheme versus four levels
Data Matrix in current use means ECC 200: Reed–Solomon, with the amount of redundancy fixed by the encoder for whichever symbol size it selects, recovering roughly 25% damage. There is no dial. That is a feature in a manufacturing context — nobody can accidentally ship a batch at the weak setting.
QR gives you L, M, Q and H, recovering about 7%, 15%, 25% and 30%. The choice is useful and it is also a way to get it wrong: raising the level adds modules, which shrinks each module at a fixed physical size, which is the opposite of what a small code needs. That trade-off is worked through in what L, M, Q and H really cost you.
Note that ECC 200 sits at roughly QR’s level Q, not H. If you need to survive a logo overlay, QR at H is the only one of the two that goes further — and Data Matrix codes do not carry logos anyway.
The 5 mm part, and direct part marking
Below about 10 mm square, Data Matrix stops having competition. A short serial number in a 12 × 12 symbol prints at 2–3 mm and is still read by a decent imager. The same content as a QR code, with its four-module quiet zone, needs more than twice the width for the same module size.
Direct part marking pushes it further. Dot peening, laser etching and chemical etching produce marks that are never as clean as ink on paper, on surfaces that are curved, reflective, oily or repeatedly autoclaved. ECC 200’s fixed 25% recovery and the one-module quiet zone are what make that survivable, and it is why the mark on a circuit board, a surgical instrument or an aerospace fastener is almost always a Data Matrix. The Data Matrix generator page has the full size and capacity table.
Why QR wins the moment a phone is involved
Everything above is irrelevant if the reader is a member of the public.
Phone cameras have been tuned for QR for the best part of a decade. Both platforms decode it in the native camera app with no extra software, users recognise the shape and know what to do with it, and the three corner finders give the fast lock that makes a one-handed scan across a room feel instant. Data Matrix support in phone cameras exists but is inconsistent between OS versions and builds, and no consumer has ever been told to point their camera at one.
So the rule is blunt: if a person scans it, QR; if a machine scans it, consider Data Matrix. A code on a poster, a menu, a business card, a shelf edge or a piece of packaging aimed at shoppers is a QR code even when Data Matrix would be technically neater.
GS1 Data Matrix, healthcare and UDI
Regulated supply chains have largely standardised on GS1 Data Matrix, which is the same symbology carrying GS1 Application Identifiers preceded by an FNC1 character. That prefix is what lets a scanner split the payload into GTIN, batch number, expiry date and serial number as separate fields rather than one string.
It is the carrier for the unique identifier the EU Falsified Medicines Directive requires on prescription packs, and it is the usual carrier for Unique Device Identification marking on medical devices, where the same identifier often has to appear both on the packaging and etched directly onto an instrument that will be sterilised hundreds of times. The size advantage and the direct-marking durability are exactly why that choice was made. The current GS1 General Specifications are the authority on which Application Identifiers apply to your case.
The trap worth naming: typing GS1-looking digits into a plain Data Matrix produces a symbol that looks identical and is not a GS1 Data Matrix. Without FNC1 and correctly formed AIs, a compliant system will not parse it.
Reader support in the real world
| Reader | QR | Data Matrix |
|---|---|---|
| iOS / Android native camera | Reliable | Usually works, varies by build |
| Consumer scanner apps | Universal | Common |
| Handheld imaging scanner | Yes | Yes |
| Fixed industrial imager | Yes | Yes, the usual choice |
| Laser scanner (1D only) | No | No |
| Vision system on a production line | Yes | Yes, better at small marks |
Neither is readable by a laser scanner — if your warehouse still runs 1D-only laser guns, the answer is Code 128, not either of these. That decision, and where each symbology belongs on a bin, a carton or an asset tag, is covered in choosing a barcode for inventory labels.
The decision table
| If… | Use |
|---|---|
| A consumer will scan it with a phone | QR |
| The mark is under about 10 mm square | Data Matrix |
| It is etched, peened or lasered onto a part | Data Matrix |
| It carries GS1 AIs in a regulated supply chain | GS1 Data Matrix |
| It carries a URL for marketing or information | QR |
| It needs a logo in the middle | QR at level H |
| It must be read from more than a metre away | QR |
| It goes on a curved or reflective surface | Data Matrix, marked flat |
| It is a boarding pass, a driving licence or a dense document | PDF417 |
| It is a transport ticket needing no quiet zone | Aztec |
All eleven symbologies, with their real data rules and a live generator for each, are on the barcode generator.
Frequently asked
Is Data Matrix smaller than a QR code for the same data?
Can a phone camera read a Data Matrix code?
What error correction level does Data Matrix use?
Is a Data Matrix with GS1 data the same as a GS1 Data Matrix?
- data-matrix
- qr
- gs1
- labels
- udi
Make the code this guide describes
The generator runs in your browser — add a logo, pick colours, tag the link with UTM parameters and download a PNG or SVG. No account, no watermark.
Keep reading
-
Barcodes
Choosing a barcode for warehouse, asset and inventory labels
Which symbology to put on a bin, a carton, an asset tag or a 5 mm component, plus the X-dimension and print settings that decide whether it scans at all.
-
Barcodes
EAN-13 vs UPC-A: which one your product needs
UPC-A is an EAN-13 with a leading zero, so the real question is where your number came from. Digit counts, check digits, GS1 prefixes and the case code.
-
Barcodes
Barcode or QR code, and what converting one into the other really means
A QR code is a barcode. Converting between the two means re-encoding the data, not transforming an image — and at a checkout that distinction decides it all.