MIL-STD-130 UID Marking Label Generation

Barcode Information | Tutorials | FAQs at

This tutorial outlines how to generate MIL-STD-130 UID Marking labels using Code 128 or ECC200 Data Matrix in conjunction with the IDAutomation Barcode Label Software, or IDAutomation Barcode Fonts.

MIL-STD-130, UID and IUID Marking Label implementation requires specific formatting and placement. This tutorial focuses specifically on generating the barcode according to MIL-STD-130N.

UID Marking Label Implementation

There are several types of UID Marking Labels that may be created within the MIL-STD-130 specification. This tutorial uses the GS1 2D Data Matrix symbol in Fig. 8 from the MIL-STD-130N specification. This label will encode the following fields as well as GS1 AIs.

 Field Name



Field Type

 Serial Number21MH80312Incrementing
 SPLR ID GS1950614141Constant
 Part Number24099999Constant or Incrementing

This specific UID Label requires the data to be encoded in ISO/IEC 15434 Format “05” which defines a specific header, group separator and trailer.

Popular ISO/IEC 15434 Formats



Group Separator



 05[)><RS>05<GS><GS><RS><EOT>GS1 AIs
 06[)><RS>06<GS><GS><RS><EOT>ASC MH 10 AIs
 12[)><RS>12<GS><GS><RS><EOT>Structured data

Therefore, the data above would be encoded as:

The <RS>, <GS> and <EOT> commands defined above represent non-printable ASCII characters 30, 29 and 4. ASCII characters may be encoded with ApplyTilde in IDAutomation Data Matrix products. The complete text string to use as the “data to encode” for any IDAutomation product, such as the Data Matrix Font and Encoder, would be:

When testing the barcode with a scanner, IDAutomation’s Free Barcode Scanner ASCII String Decoder may be used to view the <RS>, <GS> and <EOT> commands. Implementation and testing may be easily accomplished with IDAutomation’s Online Barcode Generator for Data Matrix with the following URL:[)>~d03005~d029800406141419999960MH80312~d02921MH80312

Generating UID Labels

  1. The IUID is encoded in the Data Matrix barcode type, which is offered in the IDAutomation Barcode Label Software Pro. Download the demo or purchase online, then install.
  2. Open the Label Software. Ensure no objects are selected on the label and that it is blank, then choose EditProperties, which opens the label properties dialog.
    1. Choose the Label Fields tab.
      Add the field names from the chart above with appropriate data.
    2. Choose the Rename Field link to rename each field so it may be properly referenced within the label. Notice that the SerialNumber field is an incrementing number, which cannot contain text, therefore, the AI and text portion of “21MH” will be added in the formula as the other AIs are.
      IUID Marking Label Fields
  3. To make formulas easier to edit, enter the Header, GS and EOT as fields of ISO/IEC 15434 Format 05 on the Label Fields 2 Tab.
    Entering Header, GS and EOT as Fields of ISO/IEC 15434 Format 05 Make Formulas Easy To Edit
  4. Choose the Data Matrix icon to add it to the label, right-click on the Data Matrix object and choose Properties.
  5. Choose the DataMatrix tab; enable Apply Tilde and ensure ASCII Mode is selected as the encoding mode.
  6. Choose the Value tab. Change the Value Type to Formula and enter the VB script below. Notice that each row begins with a header or GS, the AI and a data field.
    LabelField(Header) & "8004" & LabelField(UII)
    & LabelField(GS) & "21MH" & LabelField(SerialNumber)
    & LabelField(GS) & "95" & LabelField(SPLR) 
    & LabelField(GS) & "240" & LabelField(PartNumber)
    & LabelField(RS) & LabelField(EOT)

    Change Value Type to Formula and Enter VB Script.

  7. Select Apply. If errors occur, check the VB script formula syntax. Test scan the result with a Data Matrix Barcode Imager and verify that the correct ASCII characters are encoded with the Barcode Scanner ASCII String Decoder. The result from label 1 should scan as:
  8. The barcode should now be complete. When the labels are advanced or printed, the barcode should change. The VB script formula may be changed accordingly. After a successful print job, the serial number field is advanced to the last printed label so that the same number will not print twice. This unique serial number memory functionality is provided in all versions of the
    IDAutomation Barcode Label Software.
  9. Human readable text interpretations may be created in the same way, when necessary, with a text object on the label. In text interpretations, the Header, GS and EOT should not be included and the VBCRLF should be used to create a new line.
    "(8004) " & LabelField(UII) & VBCRLF & 
    "(21MH) " & LabelField(SerialNumber) & VBCRLF & 
    "(95) " & LabelField(SPLR) & VBCRLF & 
    "(240) " & LabelField(PartNumber) & VBCRLF
  10. The label used in this example may be downloaded and used in the Pro and RFID versions of the IDAutomation Barcode Label Software.
  11. If MOD 10 calculations need to be performed within the formula, consider the MOD10() macro provided with the Barcode Label Software.
Code-128 UID Marking Label Generation
  1. Using the information from the chart above, the AI of 8004 encodes the GIAI in Code 128 according to the GS1 128 section of the IDAutomation Code 128 Barcode FAQ.
  2. Therefore, the complete text string to use as the “data to encode” for any IDAutomation product, such as the Code 128 Font Package, would be:
  3. Open the Barcode Label Software application and add a linear barcode object. Choose the Encoding tab and enable the Apply Tilde feature.
    Add Linear Barcode Object and Enable the Apply Tilde Feature in the Encoding Tab.
  4. Choose the Value tab. Change the Value Type to Formula and enter the VB script below.
      "~214" & "8004" & LabelField(UII)
  5. Test scan the result with the IDAutomation USB Scanner or other Compatible Scanner. The result should scan as:
  6. The label used in this example may be downloaded and used in the Pro or RFID version of the IDAutomation Barcode Label Software.
    Add Linear Barcode Object and Enable the Apply Tilde Feature in the Encoding Tab.
ATA and CEA Marking Label Generation
  • Generation of Data Matrix ATA and CEA labels are the same as described above, except different ISO/IEC header formats are used. For example, the complete text string to use as the “data to encode” for any IDAutomation product, such as the Data Matrix Font and Encoder, for the Data Matrix symbol in Figure 5 would be:
    [)>~d03012~d029MFR1U2R7~d029SEQ MH80312P~d029PNOF100200300400AP~d030~d004
  • For linear barcodes, the FNC1 characters are not included in the data encoded. For example, the first linear barcode in figure 5 of the MIL-STD-130N specification is encoded just as it reads
    MFR 1U2R7.
MIL-STD-130 Refinements and Versions
  • MIL STD 130L which laid the foundation for unique item identification (UID) and machine readable information (MRI)
  • MIL STD 130L released in 2004 provided improved definitions for the quality standards of the linear barcode and 2D Data Matrix UID Marking.
  • MIL STD 130M in 2005 made significant improvement in further defining approved implementation guidelines for UID Markings.
  • MIL STD 130N is the latest specification for implementation of UID and IUID, including Change 1, using Data Matrix ECC200 and Code-128 as of November, 2012.