How Can I Generate a GS1 Data Matrix?

  • Adjust Data Matrix as symbology
  • Set the Data Matrix format property to EAN or GS1. This adds an FNC1 on the first data code word position which marks the barcode as GS1/EAN type.
  • Enable Escape Sequences
  • Use the sequence \F to encode an FNC1 as separator between variable length AI fields. If the barcode reader reads such a FNC1 it will return GS (ASCII 29) instead.
Don't encode \F as first data character by yourself (this would lead to incorrect internal data format). Use the DM format property instead (as shown above).

What's Important When I Create a HIBC Barcode?

The Asterisk '*' within the HIBC Standard

Depending on the bar code type the * character is used specifically. Code 39 utilizes an asterisk character as a start and stop indicator - in this case TBarCode generates the asterisk character automatically. With Code-128 the asterisk character is not encoded into the bar code symbol but displayed in the text below (according to ANSI/HIBC 2.2 - 2006).
Important: The barcode scanner does not transmit the start and stop character, only the raw data.

That means

  • According to the HIBC standard the raw data does not contain any * character.
  • TBarCode optionally allows to enter the barcode data with '*' start and stop character when using a code 39 symbology. But this option is not available for the Code 128 symbology.
  • The * character is always displayed in the text line below no matter if the character is encoded or not.

Once you choose a HIBC barcode symbology the TBarCode software complies with these guidelines.

Check Digit

The HIBC format requires a check digit. If a HIBC barcode symbology was chosen, TBarCode calculates and attaches it automatically. Normally you can enter the data WITHOUT the check digit. If the data already contains the check digit just disable the check digit in the TBarCode options. Otherwise two check digits are attached and you will get a faulty barcode!

Data Format

The HIBC standard distinguishes between the LIC and the PAS data format. The barcode data is validated according to the HIBC type. If needed an error message will be displayed.

Advanced Links

How Can I Create a VCard Barcode?

VCard is not a bar code itself, it is a special file format, which can be used to store data in a bar code (e.g. into QR Code). A detailed description of the VCard format can be found here:
Wikipedia - VCard Specification

Just bring your data into the given format and you'll be able to read the barcode with your mobile phone and recognize the data as contact information.

Create VCard barcodes with Barcode Studio

With our Barcode Studio we offer an Assistant to create VCard barcodes the easy way.

How to Encode Binary Data (2D Codes)

Even if you use an escape sequence for binary data the encoder will use Codepage Conversion (example: \x88 leads to a different value in Data Matrix as desired).


  • Switch off codepage conversion (use Encoding Mode LowByte)
  • Force binary encoding mode if available (see PDF417 Encoding Mode, Data Matrix EnforceBinaryEncoding)
Relevant for DP Premium Address and other applications where you encode binary data in a 2D symbol (Data Matrix etc).

How to Encode FNC1 (GS1 Barcodes)?

What's FNC1?

FNC1 is used as separator character for variable length data fields in the application identifier standard. It can be encoded with \F. Sample: The data field for the batch or lot number varies in length (up to 20 characters) and needs a termination (FNC1).

Please consider:

  • To encode FNC1 Escape-Sequences must be enabled.
  • Don't insert FNC1 after the last data field.
  • Insert FNC1 even if the maximum field length is used.

Example 1: FNC1 in TBarCode

In this example we generate a GS1-128 barcode with 2 Application Identifier. The batch or lot number (AI =10, variable length so it needs FNC1) and the best before date (AI=15).

' set the barcode type = GS1-128 (EAN/UCC 128)
TBarCode101.BarCode = eBC_GS1_128

' enable Translate Escape Sequences
TBarCode101.EscapeSequences = True

' set the data to be encoded
TBarCode101.Text = "10222333\F15100701"

Example 2: FNC1 in Barcode Studio

We use the same sample data like before. To add the functional character FNC1 to your barcode data follow the steps:

  1. Enter the barcode data „10222333\F15100701“ .
  2. Switch to the tab "Settings" and check Escape Sequences.
  3. FNC1 will be insert and the Application Identifier (AI=15) is recognized automatically in the HRT.
  4. In Barcode Studio 11.5+ you can use the new Assistant for GS1 Application Identifiers.

How to Encode Control Characters like TAB or ENTER in a Barcode?

Why Should I Embed Control Characters in a Barcode?

Barcodes with embedded control characters are useful to automatically confirm input or to tab into next edit field when being scanned with a keyboard wedge barcode scanner. TEC-IT's barcode software offers the possibility to encode placeholders for such control characters utilizing so called "escape sequences".

What Are "Escape Sequences"?

Escape sequences are placeholders for control characters. An escape sequence is created by a backslash followed by at least one letter to select the function. For example, backslash followed by a lower-case t stands for TAB, backslash followed by a lower-case n for ENTER.

Which Control Characters Are Supported?

Our barcode software products support a large number of control characters. You will find a complete list of supported control characters on page 17 in our Barcode Reference.

Watch the video to learn more!


  • Escape sequences exist of one backslash (\) followed by at least one letter to select the function.
  • To encode control characters (and ensure the correct interpretation when being scanned) make sure to enable processing of “Escape Sequences”. The exact way on how to do this depends on the product you are using.

How to Encode GS, RS and EOT into a 2D Barcode?

RS, GS and EOT are ASCII control characters, which are used to format data in a 2D bar code (see ISO/IEC 15434). Because they are unprintable you need to use special escape sequences to encode them in the bar code data.

  • \x1d - GS, Group Separator, ASCII Code 29 (Hex 1D)
  • \x1e - RS, Record Separator, ASCII Code 30 (Hex 1E)
  • \x04 - EOT, End of Transmission, ASCII Code 04 (Hex 04)

In order to convert the hexadecimal sequences (starting with \x...) into their ASCII value, you have to enable Escape-Sequences (Translate Escape Sequences) in the bar code properties.

Format 06 Example: [)><RS>06<GS>SP66831000G<GS>SV9117327G<GS>S16S3.0G<RS><EOT>
Data to encode   : [)>\x1e06\x1dSP66831000G\x1dSV9117327G\x1dS16S3.0G\x1e\x04
Note: The header and trailer of Format 06 can be encoded using Macro 06 Format (see 2D specific bar code properties).
If you want to verify the bar code data with your mobile bar code reader app, please consider that RS, GS and EOT are often just displayed as a blank. To verify what's exactly in a 2D bar code, you can use the BCTester Freeware

What Are the Correct Font Settings for EAN-13 or UPC-A?

EAN-13 / UPC-A can be printed in several sizes. The possible sizes can be found in the specification. The nominal module width is 0.330 mm (optimized for 300 dpi printers it would be 0.339 mm). The human readable font must be adapted to these sizes.

The specification says that a "clearly legible font shall be used" for the human-readable digits, and OCR-B (as defined in ISO 1073-2) with a height of 2.75 mm at nominal size is recommended. Because this font is referenced only as a convenient standard typeface, you can use Courier or Arial (Bold) if you don't have the OCR-B font available.

It is not part of the specification but you can use this kind of formula to get a useful font size (based upon the module width parameter).

FontSize [pt] = ModuleWidth [mm] / 0.339 * 10
  • EAN13 (module width X=0.339mm) = font size 10pt (optional: bold)
  • If module width X would be 0.5 mm = font size 14,7pt

The formula above can be used for other barcodes, too.

What Are Data Segments in GS1 DataBar / RSS Expanded?

GS1 DataBar Expanded (alias RSS Expanded) symbols are constructed as a sequence of triplets, each consisting of a finder pattern between two symbol characters. Such a triplet contains 2 data segments (symbol characters).

2 segments forming a "triplet" consist of 17+15+17 modules. The left and right guard pattern for the symbol consist each of 1 bar + 1 space.

Per segment/data character you can encode 12 bits. Each symbol is prefixed with a check character. So the smallest symbol, which uses at least 4 symbol characters (containing 1 check char) can encode 36 Bits.

Input data is processed with a character set mapping algorithm + error recognition. With a simple formula it would be hard to predict how many data segments are required for a given set of input characters.

TEC-IT software allows you to adjust the number of data segments per row in GS1 DataBar Expanded Stacked

How to Use the Compressed Mode of Code 128?

Simply select Code128 as the bar code type. Make sure to clear the Format string. Code 128 auto compresses data by default (and subset switching is done automatically).

How Can I Calculate the GTIN Check Digit with GS1 Data Matrix?

Assuming you have several Application Identifiers to encode (01-GTIN + 17-Expiration Date + 10-Batch Lot...) and you want to calculate the check digit of the GTIN number with TBarCode, proceed as follows:

Set Property Format = 01#############^
Set Property Translate Esc Sequences = True
Set Property CheckDigit = EAN-14 (complies with Mod-10 used with GTIN)
Set Property DMFormat = EAN

Set Property Text = GTIN (13 digits, no check digit) + 17 + Exp. Date + 10 + Batch Lot Number

Note: Encode the leading GTIN number without 01 and with only the first 13 digits (no check digit).The "^" character in the format property controls the position, where the calculated check digit will be automatically inserted. The leading 01 AI for the GTIN is also contained in the format string.

The resulting barcode data will be as follows:

10 + GTIN (13 digits + 1 check digit) + 17 + Exp. Date + 10 + Batch Lot Number

How Can I Generate a PPN Code or a NTIN Code?

The data structures of the IFA PPN und GS1 NTIN Code are encoded with a Data Matrix ECC200 symbology (ISO/IEC 16022). The IFA version is using Data Matrix Macro 06 mode, while the GS1 version is based upon Data Matrix with FNC1. A specific range for the cell size and module width has been defined as well.

More information: Encoding PPN and NTIN Numbers (German)


Set Data Matrix format to Macro-06.

Library/DLL:      BCSet_DM_Format (pBarCode, eDMPr_Macro06)
TBarCode/X:     --DMformat=4

This will add a header of "[)>" + RS + "06" + GS and a trailer of RS + EOT to the encoded data.

User Data (Example):



9N ..... PPN
1T   ... Batch (LOT)
D     ... Expiry date
S     ... Serial Number
\x1d ... GS (group separator)

Translate Escape Sequences must be activated!

Details: PPN Code Spezifikation (German)


Set the Data Matrix format to EAN or GS1. This adds an FNC1 on the first code word position. Then use Application Identifiers as shown in the GS1 specification.

Details: NTIN Code Spezifikation (German) NTIN Code Specification (English)

How Can I Generate a UID Code?

UID Codes are used as a permanent marking method in order to give equipment a unique ID. UID Codes utilize the Data Matrix ECC200 bar code symbology - this standard is supported by TEC-IT.

Unique Identification Marking (UID marking, Item Unique Identification or IUID) is a part of the compliance process mandated by the United States Department of Defense. The Unique Identification Program is a global asset tracking system for hard products. UID tracking ensures asset location and operational quality data integrity for the life of the tracked asset.

Beside selecting Data Matrix as bar code type the encoded data structure has to comply with the rules outlined in the „MIL Std 130“ specification (see also next FAQ).

More details:

Creating the world wide unique UID number can be achieved by the following methodologies (constructs) and approved equivalents:

  • UID Construct 1, composed of Issuing Agency Code, an Enterprise Identifier, and a Serial Number unique within the Enterprise
  • UID Construct 2, composed of Issuing Agency Code, an Enterprise Identifier, a Part Number and a Serial Number (unique within the Part Number)
  • The following IUID Equivalents are also approved: Vehicle Identification Number (VIN), Global Returnable Asset Identifier (GRAI), Global Individual Asset Identifier (GIAI), Electronic Serial Number (ESN, typically assigned to cell phones)

Accepted Issuing Agencies:

  • DoD and NATO
  • D-U-N-S (Dun & Bradstreet)
  • GS1 (formerly EAN/UCC)

After getting a world wide unique enterprise ID from one of the listed Issuing Agencies, suppliers can number their products with UID Construct 2. Often an existing serial number management can be re-used for that process. Suppliers in the US can use the CAGE code as enterprise ID. In other countries the NATO or GS1 can issue enterprise IDs. If a company already owns a DUNS number it can be used as well.

How Can I Generate a Data Matrix in Accordance with MIL Std 130 N?

The Data Matrix symbol according to MIL Std 130 N is based on ISO/IEC 16022 Data Matrix ECC200, this is the same standard which is used by TEC-IT. The module width may be between 0.19 mm and 0.635 mm, and must be adjusted so that final symbol width does not exceed 25.4 mm.

For more details, see MIL Std 130 N specification (chapter

Data Structure:

The structure of data depends on the label, whereas Application Identifier, Data Identifier or TEI can be selected (see specification 5.2.4 Syntax).

  • If you choose Application Identifiers, you should select Format Indicator 05 as shown below:
    Library/DLL:      BCSet_DM_Format (pBarCode, eDMPr_Macro05)
    TBarCode/X:     --DMformat=3

    Result: In the data stream, a header of "[)>" + RS + "05" + GS and a trailer of RS + EOT will be inserted. FNC1 is for field separation with variable-length AIs (see specification

  • If you choose Data Identifiers, you should use Format Indicator 06 as shown below.
    Library/DLL:      BCSet_DM_Format (pBarCode, eDMPr_Macro06)
    TBarCode/X:     --DMformat=4

    Result: In the data stream, a header of "[)>" + RS + "06" + GS and a trailer of RS + EOT will be inserted.

    User Data Example:



    17V ... DI for CAGE ID
    1P   ... DI for Part Number
    S     ... DI for Serial Number
    \x1d ... GS
    Translate Escape Sequences must be activated!
  • If you choose TEI, there is a separate Format Indicator 12. You must manually implement the Format 12 (header, trailer) on the user data. There is no macro (format) available in the software for this.

How Can I Encode Char Set ISO-8859-15 into PDF417?

TBarCode V9 and Barcode Studio V9 allows you to specify the target code page for the data to be encoded.

tbarcode.CodePage = eCodePage_Custom
tbarcode.CodePageCustom = 28605   ' Latin-9 on Windows

Alternatively you can use Windows API character set conversion functions.

The PDF417 "GLI" code is an indicator for the reader software, which character set is used for the forthcoming data string. The AIM ECI table contains ECI 000017 for ISO/IEC 8859-15 Latin alphabet No. 9. ECI is the successor of GLI.

The GLI or ECI indicator does not automatically convert the data to the required character set! Consider that GLI or ECI code words are not always supported by the reading software.

The GLI or ECI indicator can be insert by escape sequences into the data stream:

PDF417: \Gnnnnnn (n...6 digits specifying the GLI)

Encode: \G000017 + bar code data
If you use escape sequences, make sure that translation of escape sequences has been enabled in the barcode generator.

What is Aztec Rune Mode?

The Aztec Rune Mode can encode one single Byte of information. If it is enabled, the barcode data should contain a string, which consists of a number range between 0 and 255. This will be converted to a Byte value in the encoder sotware.

After enabling Rune Mode in our bar code software, the small 11x11 Rune Symbol (eAztecSz_Rune) is selected automatically (no extra API call required).

What is Industry Format in a 2D Code?

All newer 2D symbologies support the "Industry Format" - but what is it? The industry format works as follows:

  • An application defines an industry format specifier (e.g. 01) and standardizes this for an application area.
  • In the barcode generator you switch to Industry Format and indicate the specifier (2 digits or 1 alphanumeric character).
  • The encoder brings the format specifier into an internal data format and inserts it into the bar code header.
  • The decoder (barcode reader) recognizes the format specifier and outputs a specific prefix, including the format, in front of the utilizable bar code data. The scanner may need further configuration for that.
  • By means of the prefix the application identifies the actual bar code as industry format bar code and reacts appropriately. Other bar codes without that prefix can be ignored by the application.

Industry format may be used in closed circuits where the purpose of the data package should be clearly defined and other data formats locked out. Typically the format specifier is given in a label standard for a specific application.

How Can I Change the Size of a MaxiCode Symbol?

The USPS MaxiCode symbol has a predefined constant size, therefore the module width has been set to a fixed value in the barcode generator. With that behavior the bar code will not adapt to the bounding rectangle even if size mode eSizeMode_FitToBoundingRect has been set.

If you need to change the size of a MaxiCode symbol you need to change the module width (please see API or UI description on how to change the module width). More information about MaxiCode can be found in our Barcode Reference.