Skip to main content
New code
New code
Blog / What Are Datamatrix Codes?
Industry 11 min read

What Are Datamatrix Codes?

A plain-language introduction to Datamatrix (ECC 200) codes: how the module grid encodes data, why they survive damage, and where they show up in the real world.

What Are Datamatrix Codes?

A Data Matrix code is a two-dimensional barcode made up of black-and-white squares, called modules, arranged in a square or rectangular grid. Unlike a traditional 1D barcode, which stores information only along a single horizontal axis as a series of parallel bars and spaces, a Data Matrix code encodes data both horizontally and vertically across its grid. That second dimension is what makes it a matrix symbology rather than a linear one, and it is also the reason a Data Matrix code can pack far more information into a much smaller physical area than a barcode you would see on a grocery item.

The symbology is defined by an international standard, ISO/IEC 16022, which specifies exactly how data is encoded, how the grid is laid out, and how a scanner or camera should decode it back into readable text or numbers. Because the standard is open and implementation-independent, Data Matrix codes generated by one piece of software and printed or etched by one manufacturer can be read reliably by scanning equipment from a completely different vendor, as long as both sides follow the specification.

What Does a Data Matrix Symbol Actually Look Like?

At first glance, a Data Matrix code looks like a small square (or occasionally rectangular) grid of black and white cells, surrounded by a mandatory quiet zone of blank space at least one module wide on all four sides. Look closer and you will notice the border is not uniform. Two adjacent sides of the symbol, forming an "L" shape, are solid black lines running the full length of the code. The other two sides, opposite those solid lines, alternate between black and white modules in a regular pattern.

This asymmetry is deliberate and it is one of the more distinctive engineering details of the format. The solid L-shaped border is called the finder pattern. A scanning device looks for that unbroken perimeter first, because it is the fastest way to locate a Data Matrix symbol within a busy image and to establish which way the symbol is oriented, even if the code has been printed or etched at an angle. Once the scanner has locked onto the solid L, it reads the alternating light-and-dark border on the remaining two sides, known as the clock track (also called the timing pattern). The clock track tells the scanner exactly how many modules make up each row and column, which in turn tells it how to divide the interior of the symbol into a precise grid before it starts decoding the actual data cells.

Put simply: one border tells the reader "here is the code and here is which way is up," and the other border tells it "here is how many cells you need to count." Together they let a camera-based scanner decode a Data Matrix symbol correctly from almost any rotation, without needing a human to line it up first. This is different from how many people assume 2D codes work, and it is worth understanding because it explains why Data Matrix codes tolerate skewed or rotated scanning so well compared to older barcode formats.

Inside that border sits the actual data region, made up of individual square modules that are set to black or white according to the encoding rules in ISO/IEC 16022. Larger symbols are also broken up internally into smaller sub-grids, each with its own miniature finder and timing pattern, which helps a scanner stay accurate even across a large, high-density code.

Diagram of a Data Matrix code grid showing the solid L-shaped finder pattern and the alternating timing pattern border

How Much Data Can a Data Matrix Code Hold?

Capacity depends on how large the symbol is, because a bigger grid simply has more modules available to encode data. At the largest standard size, a 144x144 module Data Matrix symbol using ECC 200 encoding can hold up to roughly 2,335 alphanumeric characters, or around 3,116 digits if the content is purely numeric, or about 1,556 bytes of binary data. Numeric-only content packs more efficiently than mixed text because the encoding scheme can compress pairs of digits into a single codeword, which is why the digit ceiling is noticeably higher than the alphanumeric one.

Those figures describe the theoretical ceiling of the format itself, as defined by the standard. It is worth being precise about that distinction, because this generator applies its own separate, practical limit: each line of text you enter here is capped at 1,550 characters. That cap exists for reasons specific to this tool, such as keeping generation fast and the resulting symbol at a printable, scannable module size, not because the Data Matrix format itself stops working past that point. If you need to encode content close to the format's true maximum, you may need other software with a higher configured limit, but for the overwhelming majority of real-world uses, such as a URL, a serial number, a batch code, or a few lines of structured data, the practical cap here is far more than enough.

In everyday use, most Data Matrix codes carry far less than either ceiling. A part number, a tracking ID, a URL, or a GS1-formatted string with a product code, batch number, and expiry date typically runs from a handful of characters up to a few dozen. The format's real advantage in these cases is not that it can hold thousands of characters, but that it can hold a modest, useful amount of data in an extremely small physical footprint, which matters enormously when the surface available to mark is tiny.

How Does Error Correction Keep the Code Readable?

Every Data Matrix code produced today uses an error correction scheme called ECC 200, which is based on Reed-Solomon codes, the same family of mathematics used in things like CDs, DVDs, and satellite communications to recover data despite physical damage or noise. In practical terms, ECC 200 adds extra, redundant codewords to the symbol alongside the actual data codewords. If part of the printed or etched symbol later becomes scratched, smudged, faded, or partially obscured by dirt or glare, the decoder can use the surviving redundant codewords to mathematically reconstruct the missing or corrupted parts and still recover the original data correctly.

How much damage a given symbol can tolerate depends on the amount of redundancy built in relative to its size and on exactly where the damage falls, so there is no single fixed number that applies to every symbol. That said, ECC 200 reserves roughly 28 to 30 percent of a symbol's codewords for error correction in medium and large symbols, and a much higher share in the smallest ones. In practice that lets a scanner recover from roughly 15 to 25 percent of the codewords being damaged or obscured, depending on symbol size and on where the damage falls; the '30 percent' figure often quoted by vendors is a best case. This is one of the more practically important properties of the format, because it is what makes Data Matrix codes suitable for environments where a code printed on a label or etched into a surface is going to get dirty, worn, or partially scraped over the life of the part it is attached to.

It is worth knowing that ECC 200 was not the first version of the Data Matrix format. Earlier revisions, generally referred to as ECC 000 through ECC 140, used weaker schemes: ECC 000 provided no error correction at all, only basic error detection, while ECC 050 through ECC 140 used convolutional codes rather than Reed-Solomon codes. Those older approaches are now obsolete. They have effectively been retired from production use, and virtually every Data Matrix code you will encounter today, and every code produced by modern generation software, uses ECC 200. If you ever come across a reference to those older ECC levels, it is almost certainly a historical footnote rather than something you need to design around.

What Sizes Do Data Matrix Codes Come In?

The format is intentionally flexible about size, which is part of why it fits so many different applications. The smallest standard square symbol is 10x10 modules, and the largest is 144x144 modules, with a range of standard sizes in between so that the symbol can be scaled to match how much data it needs to hold and how much physical space is available to print or mark it. A short serial number might comfortably fit in a compact 16x16 or 20x20 grid, while a longer structured string with several data fields will need one of the larger standard sizes to accommodate it.

Beyond the square symbols, the standard also defines rectangular variants, ranging from small formats like 8x18 modules up to larger ones such as 16x48 modules. These exist specifically for situations where a square footprint is not practical, for example a long, narrow label on a cable, a connector, or a component with an elongated marking surface. A rectangular Data Matrix code holds the same or slightly less data than a square one of similar total module count, because the geometry is less efficient for the finder and timing patterns relative to the data region, but for many labeling situations, fitting the available space matters more than squeezing out the last bit of capacity.

Why Do Industries Rely on Data Matrix Codes Instead of Other Formats?

The core advantage of the format is data density in a small footprint. A Data Matrix code can encode meaningfully more information in a given amount of physical space than a comparable 1D barcode, and it can do so at a smaller minimum printed or etched size than many alternatives, which matters enormously once you are marking objects that are only a few millimeters across. That property is why the format shows up heavily in a specific set of industries where space is tight, durability matters, or both.

  • Electronics manufacturing. Printed circuit boards, connectors, and individual components are frequently marked with tiny Data Matrix codes for traceability through assembly, testing, and repair, often in spaces too small for any other identification method.
  • Pharmaceuticals. Unit-dose blister packs, vials, and other small pharmaceutical packaging commonly carry a Data Matrix code, often in the GS1 Data Matrix profile, encoding a product identifier, batch or lot number, and expiry date for regulatory traceability and serialization programs.
  • Medical devices. Regulatory Unique Device Identification, or UDI, requirements generally call for human-readable and machine-readable identification using an accredited issuing agency's system, linking a physical unit back to its manufacturing and regulatory record. Data Matrix is a common carrier for this, but the permitted format and direct-marking requirements depend on the jurisdiction, device class and issuing system — some devices, for example, can meet UDI requirements with a linear barcode such as UPC. A Data Matrix code generated here does not by itself make a valid UDI or GS1 label; see the FDA's UDI Basics and list of accredited issuing agencies.
  • Aerospace and defense. Individual parts are marked with Data Matrix codes under permanent marking standards, supporting traceability across a part's entire service life, including maintenance, repair, and eventual decommissioning.
  • Automotive manufacturing. Individual components are frequently marked for traceability through the supply chain and assembly process, which helps manufacturers isolate the source of a defect to a specific batch or production run if a quality issue surfaces later.
  • Direct part marking. Many industrial parts are metal, subject to heat, chemicals, or abrasion, and a printed adhesive label simply will not survive their service environment. In these cases, a Data Matrix code is marked directly onto the part itself using laser etching, which burns or discolors the surface to create the pattern, or dot peening, which uses a hardened stylus to physically indent a grid of tiny dots into the metal. Both methods produce a code that is part of the surface itself rather than something stuck onto it, which is what makes it durable enough to survive the rest of the part's working life.

What ties these use cases together is not any single industry but a shared set of constraints: a small marking surface, a need for the identifier to survive handling, cleaning, or wear over a long service life, and a requirement to trace an individual item rather than just a product category. A 1D barcode generally cannot be printed small enough or hold enough structured data for these situations, which is exactly the gap Data Matrix was designed to fill.

How Does a Data Matrix Code Differ From a QR Code?

Both are two-dimensional matrix symbologies that read in two directions and both use Reed-Solomon error correction, so at a conceptual level they solve the same basic problem. The practical differences come down to where each one tends to be used. Data Matrix codes generally support a smaller minimum printed size and higher data density per unit of area, which is why they dominate in industrial marking, small-component labeling, and other space-constrained applications. QR codes, by contrast, are far more common in consumer-facing, print-and-scan contexts, such as packaging, posters, and marketing material, largely because of how widely recognized they are and how universally smartphone cameras are set up to detect and scan them without any dedicated hardware. Neither format is strictly better than the other; they have simply settled into different niches based on those tradeoffs.

How Do You Read a Data Matrix Code?

Data Matrix codes are read with 2D imaging scanners, which use a small camera sensor, either CCD or CMOS-based, to capture an actual image of the symbol and then decode it in software. This includes dedicated handheld and fixed-mount industrial scanners as well as ordinary smartphone cameras running a suitable scanning app. Because the reader is capturing a full image rather than sweeping a single line across the symbol, it can decode a Data Matrix code from essentially any rotation or angle, relying on the finder pattern to establish orientation as described earlier.

This is a meaningful distinction from the simple, single-line laser scanners historically used for retail barcodes at a checkout counter. Those laser line scanners sweep a beam across a symbol and only work with linear, 1D barcodes; they generally cannot read a 2D matrix code at all, since there is no single line they could sweep across it that would capture the full pattern. It is worth keeping laser marking and laser scanning conceptually separate here, since both involve lasers but do very different jobs: laser marking is a manufacturing process that etches a Data Matrix code onto a part, while laser scanning is a reading technology built around 1D barcodes. If a facility is both etching and reading Data Matrix codes, it is using laser marking to create them and 2D imaging equipment, not a laser line scanner, to read them back.

For quality control, particularly in regulated industries like pharmaceuticals and medical devices, printed and marked Data Matrix codes are often verified against ISO/IEC 15415 for printed labels and ISO/IEC 29158 (the direct part mark quality standard) for marked parts, which grade symbol quality on parameters such as symbol contrast, modulation, fixed pattern damage, and grid non-uniformity, giving manufacturers an objective way to confirm a code will decode reliably before it ships.

Data Matrix was first developed at the end of the 1980s (the original patent was filed in 1988), reworked into today's ECC 200 form in the mid-1990s, and subsequently formalized into the international standard that governs it today. If you want to see the format in action rather than just read about it, you can generate a Data Matrix code directly on this site by entering your own text, number, or structured data and downloading the resulting image.

Generate your Data Matrix codes

Enter one line of text to generate one Data Matrix code or enter multiple lines to generate multiple codes.