Scanning Data Matrix codes

Scan Data Matrix codes directly in your web apps using STRICH Barcode Scanning SDK

Overview

Data Matrix is a high-density, 2D matrix code widely used in manufacturing, healthcare, logistics and retail for efficient data encoding and retrieval. Data Matrix is standardised as ISO/IEC 16022 and GS1 Data Matrix.

A Data Matrix code
A 20x20 square Data Matrix code encoding the text “This is a Data Matrix code”

Data Matrix consists of a square or rectangular matrix of black and white cells bordered by a solid, L-shaped finder pattern on the left and bottom sides, and an alternating strip of black and white on the upper and right sides, the timing pattern. The code must be surrounded by a small amount of empty space, the quiet zone.

Data Matrix is known for being high-density, allowing considerable amounts of data to be packed into a compact space. It is often seen on small items, packaging and electronic components.

Data Matrix has strong error correction based on Reed-Solomon (ECC 200), ensuring accurate reads even if the code is partially damaged or obscured.

Square Data Matrix

Data Matrix codes are usually square and come in a fixed number of sizes, from 10x10 up to 144x144 rows/columns. Data Matrix codes can store numeric (digits) and alphanumeric (characters and digits) data.

Real-life examples of square Data Matrix codes
Real-life examples of square Data Matrix codes

Increasing the number of rows and columns increases the code's capacity, but makes also makes the code harder to read. The table below lists the code capacities in numeric and alphanumeric mode for each size.

Size Capacity
num/alpha
Size Capacity
num/alpha
10x10 6/3 44x44 288/214
12x12 10/6 48x48 348/259
14x14 16/10 52x52 408/304
16x16 24/16 64x64 560/418
18x18 36/25 72x72 736/550
20x20 44/31 80x80 912/682
22x22 60/43 88x88 1152/862
24x24 72/52 96x96 1392/1042
26x26 88/64 104x104 1632/1222
32x32 124/91 120x120 2100/1573
36x36 172/127 132x132 2608/1954
40x40 228/169 144x144 3116/2335

Rectangular Data Matrix

Rectangular Data Matrix codes are less common than square ones. These codes are often used on postage, retail items or containers.

Real-life examples of DMRE (Rectangular Data Matrix) codes
Examples of rectangular Data Matrix codes

ISO/IEC 16022 defines six rectangular sizes, ranging from 8x18 to 16x48 rows/columns. The table below lists the code capacities for each size.

Size Capacity
(numeric/alphanumeric)
8x18 10/6
8x32 20/13
12x26 32/22
12x36 44/31
16x36 64/46
16x48 98/72

STRICH supports all six rectangular sizes since version 1.14.0. The 18 additional rectangular sizes defined in ISO/IEC 21471 (Data Matrix Rectangular Extension, DMRE), which extend up to 26x64 rows/columns, will be supported in a future release.

For more information on the Data Matrix symbology and how the SDK supports it, please refer to our SDK documentation.

Scanning Data Matrix in web apps

The STRICH barcode scanning SDK allows you to scan Data Matrix codes in your web app, with just a few lines of JavaScript:

const code = await PopupScanner.scan({ symbologies: ['datamatrix'] });

Try it out now! Press the button below to scan a Data Matrix code from your smartphone's camera, and display its value here. STRICH is optimized for smartphones, scanning with a webcam will probably not be a good experience.

Scan output

For more information on Data Matrix support in STRICH, please refer to our SDK documentation.