Data Matrix code
A Data Matrix code is a small square or rectangular 2D barcode, recognised by a solid black L along two edges and alternating black and white squares along the other two. It is the code on prescription medicine packs, surgical instruments and marked parts.
Easily confused with
- QR codeA QR code is a square two-dimensional barcode, read by an imaging scanner or a phone’s camera, often to open a website. The three large squares in its corners are finder patterns, which let a reader find the code and its angle; the rest is the data and its error correction.
- PDF417 (driver’s license and boarding pass barcode)PDF417 is the wide, stacked barcode on the back of a US or Canadian driver’s license or ID card and on printed airline boarding passes. On a license, its data corresponds to what is printed on the card.
How to read it
The solid L is the finder pattern and the dotted edges are the clock, or timing, pattern; a reader uses them to find the code and its grid, so it can be read from any direction, Keyence’s guide explains. The version in use is ECC 200, standardised as ISO/IEC 16022; GS1 notes that its corner opposite the corner of the L is a light square, which tells it from older versions. Square symbols have an even number of rows and columns, from 10 by 10 to 144 by 144, and large ones are divided into blocks with their own patterns. Keyence dates the code to ID Matrix in 1987. Unlike a QR code, its error correction level is fixed by its size.
Also searched as: 2d barcode on medicine box, data matrix, datamatrix, data matrix code, ecc 200, gs1 datamatrix, square barcode on medicine.
These pages say what each code and its parts mean under the standard that defines it. A barcode identifies an item; it doesn’t say where the item was made or whether it is genuine, and the label and the maker are the place to look for that.
Where you’ll see it
On prescription drug packages in the US, the FDA’s guidance under the Drug Supply Chain Security Act says the product identifier, the NDC, serial number, lot number and expiry date, must be in a 2D Data Matrix barcode as well as printed. The FDA says a QR code can’t replace it: a QR code is a 2D barcode but not the same one, and doesn’t encode the same information. GS1 lists direct part marking too, dot-peened into car and aircraft parts, medical instruments and surgical implants.
Look-alikes
A QR code has three large squares in its corners. A PDF417 is a wide rectangle of stacked rows of bars.
Read next
- Next in Barcodes and QR codesPDF417 (driver’s license and boarding pass barcode)PDF417 is the wide, stacked barcode on the back of a US or Canadian driver’s license or ID card and on printed airline boarding passes. On a license, its data corresponds to what is printed on the card.
- The same shape in Ford dashboard symbolsFord blind spot information system lampFord’s blind spot information system lamp in the instrument cluster: it comes on when the system is switched off or has a fault. The blind spot alerts themselves light up in the exterior mirrors.
More barcodes and QR codes
The same shape elsewhere
Browse symbols drawn with squares and rectangles.
Sources
- GS1 General Specifications Standard, Release 26.0, ratified January 2026, GS1 AISBL, §5.6.1; §5.6.2
- What is a DataMatrix code? | Basics of 2D codes, Barcode Information & Tips, KEYENCE Corporation, DataMatrix code (ECC200)
- Product Identifiers Under the Drug Supply Chain Security Act: Questions and Answers, Guidance for Industry, June 2021, U.S. Food and Drug Administration, Questions 3, 4 and 6
Researched, edited and approved by Rory Hansen before publishing. Last reviewed October 9, 2026. How we research
Added .