DataMatrix - Dynamsoft Barcode Reader SDK

What is a Data Matrix Barcode?

The Data Matrix is a 2D high-density barcode symbol. Since 2000, this barcode has been recognized as a standard of ISO/IEC 16022. It encodes text, numbers, files and data bytes. It uses small square modules and the perimeter of these modules are purposely different than the interior. This helps a barcode scanner identify cell locations for proper decoding.

A common Data Matrix barcode can appear like this:


The data area is surrounded by an L-shaped frame, which is often referred to as the “alignment pattern.” The dotted lines are referred to as the “clock pattern.” These patterns are used to determine the location of parts of the barcode, such as where the edges and data are. A barcode reader will identify the patterns and confirm the bar code location using image processing technologies.

Error checking and correction

The Data Matrix barcode is one of the smaller and more reliable barcodes. It supports advanced encoding error checking and correction algorithms. The latest version, ECC200, contains the Reed-Solomon method for error correction and therefore has been internationally standardized. This barcode can often still be scanned even after suffering significant physical damage.

Code size

Data Matrix barcodes are adaptable in size. The symbol size can be as small as 2.5mm, which is the smallest among all 2D barcodes. Meanwhile, the size and encoded data capacity are independent. This allows the choice of a lot of different matrix sizes.

Square codes

Based on the size of the code, a Data Matrix code can consist of multiple blocks or only one block.

Square Data Matrix codes come in 24 symbol sizes ranging from 10 x 10 modules to 144 x 144 modules. When the code has more than 26 x 26 modules (more than 24 x 24 modules for data), it is divided into blocks. Each separated block does not exceed 24 modules on a side. This structure prevents the distortion of the code. Below is a 4-block code.

Codes with 26 modules on a side or less have one block.
10 × 10 12 × 12 14 × 14 16 × 16 18 × 18 20 × 20 22 × 22 24 × 24 26 × 26

Codes with more modules will be divided into 4, 16 or 36 blocks:

Four blocks
32 × 32 36 × 36 40 × 40 44 × 44 48 × 48 52 × 52
Four blocks
64 × 64 72 × 72 80 × 80 88 × 88 96 × 96 104 × 104
Thirty-six blocks
120 × 120 132 × 132 144 × 144

Rectangular codes

The rectangular type varies in six different module sizes:

  •   8 x 18 modules (1 block)
  • 12 x 26 modules (1 block)
  • 16 x 36 modules (1 block)
  •   8 x 32 modules (2 block)
  • 12 x 36 modules (2 block)
  • 16 x 48 modules (2 block)


Of all the sizes, 144 x 144 has the largest capacity, which can theoretically hold up to 3116 digits, 2335 alphanumeric characters, or 1556 bytes.

Encoding and decoding of a Data Matrix barcode are considered to be difficult. They are commonly scanned with a camera-based scanner.

Where is a DataMatrix used?

Label small items

The most popular application for Data Matrix is labeling small items, such as small electronic components and pill bottles.

Environments with a high risk of contamination

With error checking and correction algorithms, a Data Matrix barcode is still recognizable with up to even 60% damage. This allows usage under high heat, chemical exposure, environments with a high risk of contamination, and more. Consequently, the Data Matrix barcode is widely applied to electrical rating plates, surgical instruments, circuit boards, etc.

Direct part marking

Direct Part Marking (DPM) is a process that enables people to manage or track components, devices or equipment with a permanently etched barcode. There are many ways to encode information to a machine-readable code. The preferred codes are the Data Matrix and the QR Code.



  • Electronics
  • Retail
  • Government
  • Marketing
  • Mail
  • Electronics
  • Medical
  • DPM is often used by automotive, aerospace, and electronics manufacturers to facilitate a reliable identification of their parts.

How could Dynamsoft help you with DataMatrix?

Dynamsoft barcode reader enables you to efficiently embed high-speed and reliable barcode reading functionality in your web, desktop or mobile application using just a few lines of code.

Download the free trial SDK, explore our helpful resource center including sample codes, tutorials, guides and more to get started.