Data Matrix 2D Barcode ISO/IEC 16022 FAQ

Barcode Information | Tutorials | Examples

The Data Matrix barcode (ISO/IEC 16022) is a high-density, two-dimensional (2D) symbology that encodes text, numbers, files, and actual data bytes. This FAQ provides information and answers to commonly asked questions about the 2D Data Matrix barcode symbology.

Data Matrix Barcode Overview

Data Matrix 2D Barcode ISO/IEC 16022Data Matrix is a very efficient, two-dimensional (2D) barcode symbology that uses a small area of square modules with a unique perimeter pattern, which helps the barcode scanner determine cell locations and decode the symbol. Characters, numbers, text, and actual bytes of data may be encoded, including Unicode characters and photos.

The encoding and decoding process of Data Matrix is very complex. Several methods have been used for error correction in the past. All current implementations have been standardized on the ECC200 error correction method, which is approved by ANSI/AIM BC11 and the ISO/IEC 16022 specification. IDAutomation 2D Data Matrix barcode products all support ECC200 by default and are based on the ANSI/AIM BC11 and the ISO/IEC 16022 specifications. The Reed-Solomon error correction algorithms of ECC200 allow the recognition of barcodes that are up to 60% damaged.

Specific standards & specs for the 2D Data Matrix barcode symbology:

  • AS9132 – Society of Automotive Engineers (SAE) parts marking
  • Air Transportation Association’s (ATA) Spec 2000
  • Automotive Industry Action Group (AIAG):
    AIAG B-4 – parts identification
    AIAG B-8 – shipping labels
    AIAG B-11 – tire and wheel identification
    AIAG B-13 – symbology white paper
    AIAG B-17 – direct parts making
  • DOD UID – Department of Defense Guide to Uniquely Identify items
  • EIA 706 – Electronics Industry Marking Standard
  • EIA 802 – Electronics Industry Marking Standard
  • GS1 Data Matrix – standard for encoding GTIN numbers on small items with camera-based readers
  • ISO/IEC 15418 – symbol data format semantics
  • ISO/IEC 15434 – symbol data format syntax
  • ISO/IEC 15415 – 2-D print quality standard
  • MIL-STD-130 – US DOD Department of Defense standard
  • NASA-STD-6002 – aerospace parts marking
  • NASA-HDBK-6003 – aerospace direct part marking methods and techniques
  • SAE AS9132 – Society of Automotive Engineers (SAE) aerospace industry marking standard
  • Semiconductor Equipment and Materials International (SEMI):
    T2-0298E – silicon wafers marking
    T3-0302 – wafer box labels
    T7-0302 – double-sided wafers
    T8-0698E – flat panel display substrates
    T9-0200E – lead-frame strips marking
    T10-0701 – direct mark quality test method
  • X6721 – Korean standard


Data Matrix Size and Accuracy

Data Matrix is one of the smallest and most dependable barcode symbologies. Compared to other barcode types, DataMatrix is approximately 30 times smaller than a Code 39 barcode representing the same data. The size difference of popular barcode types is compared in the Barcode Symbology Evaluation and Test Sheet. The 2D Data Matrix barcode is also the recommended choice when sending barcodes over faxed documents because the symbol can withstand many poor resolution and scanning issues.

The required Reed-Solomon error correction built into Data Matrix ECC200 is able to reconstruct and verify the data scanned for improved accuracy. In a study at The Center for Automatic Identification at Ohio University, the statistical probability of a misread error with Data Matrix is 1 in 10.5 million scans, compared to a misread error probability of 1 in 1.7 million with the Code 39 barcode.

Printing & Generating Data Matrix

The IDAutomation Data Matrix Barcode Font and Encoder is a collection of encoders and components that generate ECC200 Data Matrix symbols with fonts or graphics. Several types of encoders are available in the package to generate Data Matrix symbols.

The IDAutomation 2D Image Generator includes a local generation Windows application that can easily create single or multiple Data Matrix image files. To generate dynamic content symbols, IDAutomation offers Native Barcode Generators for Crystal Reports, Microsoft Access and JavaScript that create symbols without any plug-ins or fonts. Barcode Integration Guides are also available that offer one or more integration options. These options may be examined to determine the best implementation method. A few of the guides offered include the following:


Verifying Barcodes

Symbols may be verified with the IDAutomation Barcode Data Decoder Verifier App or the Barcode Scanner ASCII String Decoder desktop application. Both reveal hidden control characters such as the FNC1, GS, RS, and EOT. The app has additional capabilities such as decoding HRI in GS1 symbols and reporting the symbol size. When downloaded to a mobile device, it easily reads from the screen or printed material.

The Data Decoder Verifier App scans and decodes HRI in GS1 symbols


Reading Data Matrix Barcodes

The most common method of reading Data Matrix barcodes is with a camera-based image reader (aka: barcode imager). A common implementation is to use the camera on a mobile device. IDAutomation offers the Barcode Data Decoder Verifier App & SDK which allows Xamarin app developers to customize the app for specific implementations.

On desktop computers, most hand-held barcode imagers perform keyboard emulation and receive power from the USB port so that no external power supply is needed. When a barcode symbol is read using keyboard emulation, the data appears at the cursor as if it had been typed in from the keyboard. In many cases, it may be desired to have the scanner trigger a form or action in an application. IDAutomation has documented simple methods of accomplishing this task in the USB Barcode Scanner Application Integration Guide.


Encoding ASCII Functions (such as Tabs & Returns)

DataMatrix allows ASCII codes to be easily encoded for various functions such as tabs, returns, and the RS, GS, and EOT characters required for ISO/IEC 15434 and DOD UID labels. In all IDAutomation products, the tilde (~) may be used to encode ASCII functions according to the documentation. For example; ~d009 is used to encode a tab and ~d013 encodes a return. These functions are not usually visible when scanned unless the Barcode Scanner ASCII String Decoder or the Barcode Decoder App is used.

In many development environments, Chr or Char may also be used to encode the ASCII value directly.

For example, the programming examples below encode ECC<tab>200: 

ProcessTilde: = “ECC~d009200″
= “ECC” + (char)9 + “200”;
Visual Basic: = “ECC” & Chr(9) & “200”


Encoding Double Byte, Unicode & Extended ASCII

All 256 ASCII characters can easily be encoded with the BASE256 encoding mode, which encodes all data, byte-by-byte. For information about encoding and decoding UTF-8 and Unicode characters, refer to the UTF-8 and Unicode Encoding FAQ.


Amount of Data Encoded

It is recommended to limit the amount of data encoded in each symbol to 800 characters or less if possible. Although the AIM Data Matrix specifications state, “up to 2335 alphanumeric characters can be encoded,” it has been determined that these numbers are not realistic. The amount of data that can be encoded will vary depending on the type of data, the encoding mode, and what the scanner can read. In most implementations, the amount of data that can be encoded is significantly decreased due to mode switching between different types of characters, such as between numbers, upper case, lower case, and punctuation.

Most camera-based imagers and hand-held scanners have a difficult time reading symbols that contain over 800 characters. In the best-case scenario, up to 1200 ASCII characters have been successfully encoded and read by using the text encoding mode of the IDAutomation Data Matrix Barcode Forms Control with the IDAutomation 2D Barcode Scanner.


DataMatrix Encoding Modes & Determining Size

Products such as the IDAutomation Data Matrix Barcode Fonts and the Data Matrix Components all support the encoding modes listed below. By default, the encoding mode for most components is BASE256. If the choice is to encode text or numbers only and size is a concern, a change of the encoding mode to ASCII may produce a smaller symbol. Valid values are 0 for BASE256, 1 for C40, 2 for TEXT, and 3 for ASCII.

  • 0 – BASE256 is used to encode 8 bit values, bytes of data.
  • 1 – C40 is used to encode data that primarily consists of numeric and upper case characters. C40 encodes three alphanumeric data characters into two bytes.
  • 2 – TEXT is used to encode data that primarily contains numeric and lowercase characters. TEXT encodes three alphanumeric data characters into two bytes.
  • 3 – ASCII is used to encode data that mainly contains ASCII characters (0-127). It encodes one alphanumeric or two numeric characters per byte. This mode is required when encoding GS1-DataMatrix, DOD UID, or ISO/IEC 15434.

Most encoding systems can be used to encode any data; however, encoding binary data with C40 will generate much more overhead (a larger symbol) than with BASE256.


Control Characters & use of the Tilde

IDAutomation Data Matrix Barcode Fonts, Components, and Applications use the tilde character “~” to recognize special characters when “Apply Tilde” or “Process Tilde” is enabled. The following tilde options are available:

  • ~dNNN: Represents the ASCII character encoded by the 3 digits NNN. For example, ~d009 represents a tab, ~d013 represents a return and ~d065 represents the character ‘A’.
  • ~1: Represents the character FNC1 commonly used for GS1-DataMatrix. When FNC1 appears in the first position, it indicates that the data conforms to the GS1 Application Identifier format.


2D Data Matrix Formats

The following table contains the size, capacity, and error correction features of each format. The encoding mode may be changed to reduce the symbol size in some situations. The chart below illustrates the symbol size, in the best-case scenario, for the amount of data encoded. The amount of data that can actually be encoded is usually less than what is stated here because of shift and error correction characters that are required for data within the symbol. IDAutomation’s encoder will switch to auto mode if more symbol size is needed to encode the data provided. Maximum numeric capacity is achieved with numbers only in ASCII mode and maximum alphanumeric capacity is achieved with only numbers, spaces, and uppercase letters in C40 mode. IDAutomation has an update that encodes data more efficiently in ASCII and C40 modes. This update will be included in the 2020 Data Matrix release updates, including the Data Matrix Font and Encoder and other components. To obtain the update, (1) open a private support question, (2) include your order ID, and (3) specify the exact component you need it for. Some components, such as compiled DLLs will take longer to provide, while others such as VBA or JavaScript code, can be provided within 1 business day.


  Format NumberSymbol SizeMax Numeric CapacityMax Alphanumeric CapacityMax Binary CapacityMax Correctable Error/Erasure
  010 x 106312
  112 x 1210633
  214 x 14161065/7
  316 x 162416106/9
  418 x 183625167/11
  520 x 204431209/15
  622 x 2260432810/17
  724 x 2472523412/21
  826 x 2688644214/25
  932 x 32124916018/33
  1036 x 361721278421/39
  1140 x 4022816911224/45
  1244 x 4428821414228/53
  1348 x 4834825917234/65
  1452 x 5240830420242/78
  1564 x 6456041827856/106
  1672 x 7273655036672/132
  1780 x 8091268245496/180
  1888 x 881152862574112/212
  1996 x 9613921042694136/260
  20104 x 10416321222814168/318
  21120 x 120210015731048204/390
  22132 x 132260819541302248/472
  23144 x 144311623351556310/590
  248 x 1810633
  258 x 32201385
  2612 x 263222147/11
  2712 x 364431209/15
  2816 x 3664463012/21
  2916 x 4898724714/25

Is a License Required for Use?

Acuity CiMatrix / Siemens invented the Data Matrix ECC200 symbology and placed it in the public domain. Acuity CiMatrix and AIM Global both believe the Data Matrix ECC200 barcode is a public domain symbology and those license fees are not necessary for Data Matrix Patent Claims made by Acacia and other companies. Cognex challenged and won a case relating to Data Matrix patent claims by Acacia and Veritec.