Skip to content
QRMakery
Comparisons9 min read

Data Matrix vs QR Code

Everyone says Data Matrix is smaller. The bigger reason is the margin: a QR code needs four clear modules on every side and a Data Matrix needs one, which on a small symbol is nearly half the printed area.

Written by the QRMakery team

Published

QR code read by a phone beside a Data Matrix read by an industrial scanner
On this page8 sections
  1. 01Answer the Scanner Question First
  2. 02The Margin Nobody Counts
  3. 03Same Payload, Both Ways
  4. 04Capacity, and Why It Almost Never Decides Anything
  5. 05The Dial QR Has and Data Matrix Does Not
  6. 06What to Actually Use
  7. 07Which Numbers Here Are Measured, and Which Are Borrowed
  8. 08Common Questions

Answer the Scanner Question First

Most comparisons open with a capacity table. That is the wrong end of the problem, because capacity has probably never decided one of these in real life.

Here is what decides it. Pull out your phone, open the camera app, and point it at a Data Matrix. Nothing happens. iPhone has read QR codes from the stock Camera app since iOS 11 and Data Matrix is not part of that, and Android behaves the same way. Install a dedicated barcode scanner app and it reads one immediately, which is completely fine in a warehouse where every handset already has that app and completely useless on a poster at a bus stop.

So the first question is not which code is better. It is who is holding the scanner. Answer that and most of the rest stops mattering.

The Margin Nobody Counts

Now the part the other articles skip. Both symbologies need a clear border around them so the decoder can find the edges, and the two standards ask for wildly different amounts of it. ISO/IEC 18004 wants 4 modules of clear space on all four sides of a QR code. ISO/IEC 16022 wants 1 around a Data Matrix.

That sounds like a footnote. Work it through on the smallest symbols each one has and it stops being one.

Smallest QR code (version 1)

21 + 8 = 29 modules

48% of the printed area is empty margin.

Smallest Data Matrix

10 + 2 = 12 modules

31% of the printed area is empty margin.

Nearly half the area of the smallest possible QR code is white space you are legally obliged to leave alone. When the label is a three-millimetre square on a resistor, that is the whole ballgame, and it explains the industrial preference far better than the usual line about Data Matrix being denser.

And the margin is not optional. It is the single most common way a working code gets broken, because a designer sees white space, crops to the black edge, and ships it. We measured that failure separately in why a QR code will not scan.

Larger QR code quiet zone compared with the compact margin around a Data Matrix
The printed footprint includes the clear border. Four modules on every QR edge cost much more area than one around Data Matrix.

Same Payload, Both Ways

Four payloads, encoded both ways, counting the margin as part of the symbol because the printer has to.

The same payload, both ways. The QR figures are measured at build time by this site’s encoder at error-correction level M and decoded back before publishing. The Data Matrix figures are the smallest ECC200 square whose byte capacity holds the payload, plus one clear module a side, from the published size tables.
What is encodedBytesQR, with marginData Matrix, with marginData Matrix area
Part serial✓ QR decoded backSN-4471-A9The kind of thing laser-etched onto a component, where every square millimetre is contested.1021 + 8 = 2916 + 2 = 1839% of the QR
Shortened link✓ QR decoded backhttps://exmpl.co/mA link already shortened as far as it sensibly goes.1825 + 8 = 3320 + 2 = 2244% of the QR
Ordinary page URL✓ QR decoded backhttps://example.com/menuWhat a restaurant actually puts on a table tent.2425 + 8 = 3322 + 2 = 2453% of the QR
GS1 element string✓ QR decoded back(01)09501101020917(21)A1B2C3A GTIN and a serial, the pattern used for medical device labelling. Data Matrix packs digit pairs into one codeword, so its real symbol here is smaller than the byte-based figure shown.2825 + 8 = 3322 + 2 = 2453% of the QR

The gap narrows as the payload grows, which is worth knowing if you are choosing for a label rather than a component. At ten characters Data Matrix takes 39% of the area. By the time you are at a twenty-four character URL it is 53%, still a clear win, no longer a rout.

One thing that table does in Data Matrix’s disfavour, on purpose. The Data Matrix column uses the byte capacity of each symbol size, and Data Matrix has an ASCII mode that packs a pair of digits into a single codeword. For the GS1 row, with sixteen digits in it, the real symbol is smaller than the figure shown. I have left the conservative number in rather than model an encoding I cannot run here.

Capacity, and Why It Almost Never Decides Anything

QR holds more. 2953 bytes against 1556, and 7089 digits against 3116. Those are the numbers every comparison table leads with.

They are close to useless. A QR code carrying anything near 2,953 bytes is a version 40 symbol, 177 modules across, and at the 0.4mm per module this site uses as a floor that is a 71mm square before you add the margin. You are not putting that on a business card, and if you try to shrink it, it stops reading. Both ceilings are theoretical in the same way the top speed of a car is theoretical.

Real payloads are URLs and part numbers, and they are twenty to sixty characters. Every symbol size that matters sits in the first few rows of both tables. Pick on the margin and the scanner, not the ceiling.

The Dial QR Has and Data Matrix Does Not

Both use Reed-Solomon and both survive real damage. The difference is who chooses how much.

A QR code has four levels, L through H, and you pick one. That is the reason logos work on QR codes at all: a logo destroys modules, and moving to level H buys back enough recovery to survive it. Data Matrix fixes its error correction by symbol size, so there is no dial. You get what the size gives you.

That cuts both ways, and it is worth saying so. Fixed means you cannot get it wrong. Nobody ships a Data Matrix on level L by accident and discovers in the field that a scuff kills it. On the QR side, the default in most tools is M, and most people never touch it.

What to Actually Use

Six jobs, and the honest pick for each. Two of them go to Data Matrix outright.

  • QR codeAnything the public scans: a menu, a poster, a form, a ticketThe phone camera is the whole argument. iPhone and Android read QR codes with the stock camera app and neither reads Data Matrix without a separate app. Density stops mattering when the scan never happens.
  • Data MatrixA mark on a component measured in millimetresSmaller symbol, and a margin one module wide instead of four. On the smallest symbols that margin is the bigger of the two effects.
  • Data MatrixA medical device label carrying a UDIIt is what the issuing agencies and the labelling conventions settled on, and the scanners in that setting are imagers that read it. Bringing a QR code here is fighting an ecosystem for no gain.
  • EitherA warehouse label read by company-owned scannersBoth work, so the deciding factor is the fleet you already own and the label stock you already buy. Check what the scanners read before you change anything.
  • QR codeA code that has to carry a logo or a brand colourSelectable error correction is the reason. QR lets you buy back the modules a logo destroys by moving to level H, and there is no equivalent dial on Data Matrix, where the recovery is fixed by symbol size.
  • QR codeJapanese textQR has a Kanji mode and Data Matrix does not, which is unsurprising given Denso Wave designed it in Japan for exactly that.
QR codes used on public signs beside Data Matrix marks on a circuit board and vial
QR wins when an ordinary phone must scan the code. Data Matrix wins when the mark must fit a component and a dedicated scanner is already part of the job.

This site makes QR codes and does not make Data Matrix codes, and that is not on the roadmap. If the table above sent you to Data Matrix, go and use a generator built for it. Check the symbol against the scanner that will really read it before you commit to a print run, and be especially careful before you commit to an etching setup, because that is expensive to redo.

Which Numbers Here Are Measured, and Which Are Borrowed

Splitting this out because the two halves of this page do not have the same standing, and a comparison that hides that is worth less than one that admits it.

Measured here.Every QR figure: module counts, symbol versions, total widths with the quiet zone, and the minimum print widths. They come from this site’s own encoder at build time, at error-correction level M with a four-module quiet zone, and each symbol is decoded back before the row is published. If the encoder changes, the numbers change with it and a unit test fails.

Borrowed. Every Data Matrix figure. This product cannot generate a Data Matrix symbol, so the sizes and capacities come from the published ECC200 tables and the quiet zone from the symbology standard. I have not encoded, printed or scanned a Data Matrix to check them, and I am not going to pretend otherwise. Sources:

One number in this piece is a judgment rather than a measurement: that the smartphone scanning gap is the thing that decides most real choices. I cannot put a figure on that. It comes from the fact that neither stock camera app reads Data Matrix, which is checkable, plus an opinion about what that does to a poster, which is not.

Two neighbouring comparisons complete the set: QR code vs barcode covers why a retail barcode needs a database and a QR code does not, and NFC vs QR code covers the tap-instead-of-scan alternative.

Common questions

What is the difference between Data Matrix and a QR code?

Both are 2D codes, both are open ISO standards, and both hold roughly the same kinds of data. The differences that decide anything are these. A phone camera reads QR codes out of the box and does not read Data Matrix. Data Matrix needs one clear module of margin around it against four for a QR code, which makes it noticeably smaller in print at small sizes. QR lets you choose the error-correction level; Data Matrix fixes it by symbol size. QR holds more at the extreme top end, which almost never matters.

Is a Data Matrix a barcode?

Yes. Barcode covers both the striped kind and the square kind. The striped ones are linear or 1D, and Data Matrix and QR are both 2D or matrix codes. So a Data Matrix is a barcode, and so is a QR code, which is why you sometimes see the phrase 2D barcode used for both.

Can my phone scan a Data Matrix code?

Not with the camera app it came with. iPhone has read QR codes from the Camera app since iOS 11, and Data Matrix is not part of that. Android is the same story. A dedicated barcode scanner app will read one, which is fine in a warehouse where everyone has the app installed, and useless on a poster in the street.

Which one is smaller?

Data Matrix, and the gap is bigger than the module counts suggest, because the quiet zone counts too. For a 10-character serial number, a QR code is 21 modules plus 4 clear modules on every side, so 29 across. Data Matrix is 16 modules plus 1 on every side, so 18 across. That is 39% of the printed area for the same data.

Does Data Matrix hold more data than a QR code?

No, QR holds more at the ceiling: 2,953 bytes against 1,556, and 7,089 digits against 3,116. That comparison is close to meaningless in practice. Both ceilings are far past what any real payload uses, and a code carrying anywhere near either limit is too dense to scan off anything you would print it on.

Can I put a logo on a Data Matrix code?

You can cover part of one and it may still read, but there is no sensible way to plan for it. A logo works on a QR code because you can raise the error-correction level to H and buy back the modules the logo destroys. Data Matrix fixes its recovery by symbol size, so there is no equivalent dial to turn.

Can this site make a Data Matrix code?

No. This site generates and reads QR codes only, and that is not on the roadmap. If you need Data Matrix, use a generator that specialises in it, and check the symbol against the scanner that will actually read it before you commit to a print run or an etching setup.

Making the QR Half? The Tool Checks It

Contrast measured as you pick colours, the quiet zone kept, and the download locked until a decoder has read the finished code back.

Open the generator
All guides
  • Comparisons

    Static vs Dynamic QR Codes

    What the redirect actually buys you, measured on real encoded codes, and which payloads are worse off for it.

    16 min read