The short answer
To scan a Data Matrix code you need a 2D reader: a phone scanner app or camera that supports Data Matrix, a 2D imaging barcode scanner, or an online reader like ours that decodes a photo. Standard 1D laser scanners cannot read it. If a code won't scan, check its size, the blank border around it, contrast, glare and whether the scanner has Data Matrix enabled.
Phones and scanners differ. Where this guide says what a device can read, it names the source, and the test codes let you check your own phone or scanner in a minute.
Scan with your phone
iPhone and iPad
Apple's help page for the Camera app and the Code Scanner in Control Center (checked November 2026) talks about QR codes only and does not list Data Matrix. So do not count on the built-in camera: if nothing pops up when you point it at a Data Matrix, that is expected, not a fault in the code.
Scanner apps are the reliable route. Apple's developer frameworks include Data Matrix as a supported code type, so many App Store scanner apps read it. Pick one whose description names Data Matrix, and if you need GS1 fields split out, one that mentions GS1.
Android
In November 2025 GS1 and Google announced that Google Lens on Android reads GS1 DataMatrix codes on medicine packs and shows product information from the manufacturer, with iOS support to follow. Google does not document general Data Matrix support in Lens or in each phone's camera app, so results vary by phone and by what the code holds. Many scanner apps use Google's ML Kit, which lists Data Matrix among its supported formats.
Tips for any phone
- Fill a good part of the screen with the code. If it is tiny, move back a little and zoom rather than pushing the lens up to it: phones cannot focus very close.
- Tilt slightly to move reflections off glossy labels or screens.
- Give it light. Turn on the torch for dark shelves, but tilt to avoid its reflection.
- Hold still for a second. Dense codes with many small squares need a sharp image.
Scan with a USB or handheld scanner
Barcode scanners come in two kinds. Laser scanners sweep a red line and read 1D barcodes such as UPC, not Data Matrix. 2D imagers take a picture and read both 1D and 2D codes. For Data Matrix you need an imager: look for “2D” or “Data Matrix” on the spec sheet.
- Turn on the code types you need. Data Matrix is usually on by default, but inverted (light-on-dark) codes and DMRE rectangles are often off. The scanner's manual has setup barcodes to enable them.
- Keyboard mode types the result into whatever field has focus, like a keyboard. If symbols come out wrong (for example
@or-), set the scanner's keyboard language to match the computer's. - GS1 codes contain an invisible separator (ASCII 29) between some fields. Many scanners have a setting for how to send it, and
one to send the symbology identifier
]d2that tells software the code is GS1. The GS1 DataMatrix guide shows what the output should look like. - Codes etched or dot-peened into metal (direct part marking) are low contrast and often shiny. They usually need an industrial DPM reader with special lighting; office scanners and phones often fail on them.
Scan online from a photo
Our Data Matrix reader online decodes a code from a photo, a screenshot, a pasted image or your camera. It runs in your browser with the open-source zxing-cpp decoder, so the image never leaves your device. It shows the decoded text, GS1 fields by name, the bytes in hex (handy when a scanner shows odd characters) and the symbol size.
- Take a sharp photo, square on, with the whole code and a little blank space around it in the frame.
- Open the reader and drop, paste or choose the image, or tap the camera button.
- Compare the result with what you expected. If the reader decodes it and your scanner does not, the scanner needs a setting changed.
Data Matrix won't scan? Checklist
One question splits almost every case in two: is the problem the code, or the thing reading it? Answer it first, then work down the matching list.
Start here: take a sharp, well-lit photo of the code and open it in our Data Matrix reader. Does it decode?
Yes The code is fine. Check the scanner.
- Is it a 1D laser scanner? Laser scanners read lines, not squares. You need a 2D imager, a phone app or our reader.
- Is Data Matrix turned on? Some scanners ship with it off. Scan the “enable Data Matrix” setup code in the manual.
- Is the code light on dark? Turn on inverted (reverse) reading, or print dark squares on a light background.
- Is it a DMRE rectangle? Sizes such as 8 × 64 need ISO/IEC 21471 (DMRE) support. Enable it, or use a standard size.
- It reads, but the text is wrong? Match the scanner’s keyboard language to the computer’s, and set how it sends the GS1 separator (ASCII 29), which some programs drop.
No The printed code is the problem.
- Is there blank space all round? Keep at least 1 module (one square) of quiet zone on every side; 2 or more is safer. No borders or text touching it.
- Is it big enough for the printer? Each square should be at least 2 printer dots. See the printer dot table below.
- Is the contrast high? Black on white is best. Avoid red or pale inks, transparent backgrounds and patterned stock.
- Glare, curve or shine? Tilt the scanner or phone slightly off straight, use matte labels, and keep codes off tight curves.
- Blurred, stretched or damaged? Squares must stay square: print at 100%, never “fit to page”. Clean the print head and reprint.
Quiet zone and print size cause most print failures. The quiet zone and print size guide covers both in detail.
Test your phone or scanner with these codes
Each code below is real and was decoded by an independent reader in our tests. Scan them from the screen at 100% zoom (a laser scanner cannot read screens at all), or print this page. Start with code 1: if that one fails, nothing else will work until the reader supports Data Matrix.
-
1. Plain square
Should read:
TEST-01 SQUARENothing reads at all: the app or scanner has Data Matrix turned off, or it is a 1D-only scanner.
-
2. Rectangle
Should read:
TEST-02 RECTSome older scanners skip rectangular sizes. Use a square code, or update the scanner.
-
3. DMRE rectangle (8 × 64)
Should read:
TEST-03 DMREThe scanner does not support the newer DMRE sizes (ISO/IEC 21471). Stay with standard sizes.
-
4. Inverted (light on dark)
Should read:
TEST-04 INVERTEDReverse (inverted) reading is off. Turn it on in the scanner settings, or print dark on light.
-
5. GS1 DataMatrix
Should read:
010950600013435210TEST-05<GS>210042The <GS> is one invisible character (ASCII 29); it may show as a box, a space or nothing. Some scanners also add ]d2 in front.
If it reads but the fields run together, the scanner drops the group separator. See the GS1 tip in the scanner section.
-
6. Dense (100+ characters)
Should read:
TEST-06 DENSE: The quick brown fox …The camera cannot resolve the small squares. Zoom the page, hold steady in good light, or print codes larger.
For a printed version, download the scanner test sheet (US Letter PDF or A4 PDF) from our scanner test sheet page. It prints a set of codes at several sizes, and the page lists the expected text for each.
Size vs printer dots
A printer draws each square from whole dots. One dot per square prints unevenly, so aim for at least 2. This table shows the square (module) size each printer resolution gives, and how wide two common codes come out with a 2-module quiet zone on each side. A 16 × 16 code holds up to 16 capital letters and digits (a short part number); a 24 × 24 holds up to 52.
| Printer | Dots per square | Square size | 16 × 16 code | 24 × 24 code |
|---|---|---|---|---|
| 203 dpi | 2 | 0.250 mm 9.9 mils | 5.0 mm 0.20 in | 7.0 mm 0.28 in |
| 203 dpi | 3 | 0.375 mm 14.8 mils | 7.5 mm 0.30 in | 10.5 mm 0.41 in |
| 203 dpi | 4 | 0.500 mm 19.7 mils | 10.0 mm 0.39 in | 14.0 mm 0.55 in |
| 300 dpi | 2 | 0.169 mm 6.7 mils | 3.4 mm 0.13 in | 4.7 mm 0.19 in |
| 300 dpi | 3 | 0.254 mm 10.0 mils | 5.1 mm 0.20 in | 7.1 mm 0.28 in |
| 300 dpi | 4 | 0.339 mm 13.3 mils | 6.8 mm 0.27 in | 9.5 mm 0.37 in |
| 600 dpi | 2 | 0.085 mm 3.3 mils | 1.7 mm 0.07 in | 2.4 mm 0.09 in |
| 600 dpi | 3 | 0.127 mm 5.0 mils | 2.5 mm 0.10 in | 3.6 mm 0.14 in |
| 600 dpi | 4 | 0.169 mm 6.7 mils | 3.4 mm 0.13 in | 4.7 mm 0.19 in |
There is no universal minimum size. How small a phone or scanner can read depends on its camera, the distance and the light, so test a printed sample before a batch. Our labels tool snaps squares to whole dots for your printer's resolution and warns below 2 dots.
“Data decoded successfully” is not a grade