Chapter 2. Overview: DataBar, Fonts, and Encoder

This chapter briefly reviews the symbologies (a.k.a. barcode formats) supported by DataBar Fontware. DataBar Fontware supports all DataBar symbologies, plus Code 128 and GS1-128 (formerly known as UCC/EAN-128).

2.1. GTIN and GS1-128

2.1.1. Global Trade Item Number (GTIN)

GTIN is the acronym for Global Trade Item Number, a 14-digit number that identifies trade items developed by GS1 organization. This number has many names, such as SCC-14 (Serial Container Code) and UCC-14.

GTIN can be derived from UPC-A or EAN-13 numbers. The first digit is package indicator. Digit '0' and '9' have special meanings here - '0' often means that there is one item in the box, and '9' indicates a variable measure item. The package indicator is followed by GS1 company prefix (assigned by GS1) and item number (assigned by the company). They should be in total of 12 digits. This portion is the same as the first 12 digits in an EAN-13 number, or '0' plus the first 11 digits in a UPC-A number. The last digit is checksum, which is calculated based on Mod10 algorithm on previous 13 digits.

Because UPC-A and EAN-13 numbers can be thought as special cases of GTINs (the package indicator is '0'), a 14-digit GTIN uniquely identifies any trade item (a single item or a container).

Traditionally, GTIN is often depicted using Interleaved 2 of 5 or Code 128 symbologies. This is expected to change as GS1 is endorsing DataBar. The benefits of using DataBar is that it produces more compact barcodes, especially when comparing with UPC-A and EAN-13 symbols.

2.1.2. GS1-128

In addition to the GTIN, a trade item often communicates more information such as price, sell by date etc. In order to communicate those information in an unified method, GS1-128 was born. Each piece of data is assigned a numeric value, called Application Identifier (AI). The AI identifies the meaning and the format of the data that follows it (data field). For example, the AI for batch number is 10, and the batch number AI is always followed by an alphanumeric batch code not to exceed 20-characters. In the barcode representation, both AI and value are encoded so that the information is understood throughout the logistics chain.

A typical GS1-128 data consists of multiple data fields concatenated together. For example,


The data above contains multiple AIs and values:

  • 01 indicates that the data followed 19421123450011 is the primary identification of the item, GTIN.

  • 15 is the AI for Sell by Date. The value followed 991231 indicates that the Best Sell Date is December 31, 1999.

  • 10 is the AI for Batch Number. According to the specification, it is a variable length AI. Here the value is 101234.

GTIN can be thought as a special instance of GS1-128. In fact, there is an AI for GTIN numbers, 01. When GTIN is coded in DataBar barcodes, the AI value 01 is required to transmitted to the application even it is not coded into the barcode.

DataBar-14, DataBar Stacked, DataBar Stacked Omnidirectional, DataBar Limited and DataBar Truncated encode GTIN only. DataBar Expanded and DataBar Expanded Stacked are capable of encoding any GS1-128 data, up to 74 numeric or 41 alphabetic characters.

2.2. DataBar Family Symbologies

DataBar family formerly referred to as Reduced Space Symbology, or RSS, adopted its official new name GS1 DataBar on February 12, 2007. The GS1 board, formerly known as UCC/EAN organization, has declared that GS1 DataBar symbols and GS1 Application Identifiers shall be available in all trade item scanning systems beginning Jan 1, 2010.[2]

GS1 DataBar is really a family of bar code symbologies. Some are very small, intended for produce and small consumer packages. And some are larger, intended to carry more data needed for identifying variable-measure foods and the required content on coupons. Some can be read omnidirectional, which makes them perfectly suitable for POS applications.

Table 2.1. GS1 DataBar Family

VariantData EncodedPOSApplicationsSample Barcode
DataBar Omnidirectional14-digit GTINYesPackaged goods
DataBar Stacked Omnidirectional14-digit GTINYesPackaged goods, Produce
DataBar ExpandedAny GS1-128 data, up to 74 digits or 41 alphanumericYesVariable-measure food, Coupons
DataBar Expanded StackedAny GS1-128 data, up to 74 digits or 41 alphanumericYesVariable-measure food, Coupons
DataBar Truncated14-digit GTINNoHealth care item
DataBar Stacked14-digit GTINNoHealth care item
DataBar Limited14-digit GTINNoHealth care item

Among the seven variants, four, DataBar-14, DataBar Stacked Omnidirectional, DataBar Expanded and DataBar Expanded Stacked were designed and specifically to work at retail POS because they can be omnidirectionally read. The remaining three, DataBar Truncated, DataBar Stacked, and DataBar Limited, are not recommended to work at retail POS and were designed for very very small products (such as health-care items).

2.3. Creating Barcodes Using DataBar Fontware

Creating barcodes using fonts involves two distinct processes: encoding and rendering. Rendering is to choose the appropriate font and font size and format the encoding results. Encoding is to convert the data into a special string, refereed as Barcode String, which becomes a barcode after being formatted with the font.


In almost all circumstances, you can not just type your number and format with a barcode font to create a valid barcode. You must generate the barcode string first, and format the barcode string with the font.

We will explain in detail the font and size selection in Chapter 3, Choosing the Right Font and Size.

2.3.1. Encoding

To create a valid databar barcode, you need to call an encoder to get a special string, and format this string with our databar font. To get this string, you need to call an encoder - you can run DataBar Encoder GUI, and obtain the result from this GUI program. Or if you need to bulk generate the results, using the programming interface exposed from the encoder DLL.

DataBar Encoder GUI

This GUI program allows you to quickly create barcode string and transfer it to other programs. You are able to enter the data encoded, choose an appropriate databar font, and create the barcode on the fly. For more information, see Chapter 4, Using Encoder GUI.


This DLL is a standard Windows DLL that can be called by many programming environments, including Microsoft Office, C++, Foxpro and .Net. Most programming environments support Windows DLL directly. We provide a VBA module and a C# class that wrap around the DLL functionality.

For more information on this VBA module, see Chapter 5, Adding Barcodes in Microsoft Office. Interoperability with other programming environments are discussed in Chapter 7, Developing Application with DataBar Fontware.


This DLL is specifically designed for Crystal Reports. With this special extension DLL, you can add barcodes in a Crystal Reports instantly.

For more information about using the software with Crystal Reports, see Chapter 6, Using DataBar Fonts in Crystal Reports.

2.4. Input Format

When you call the encoder, either through its GUI interface, or its programming interface,you need to pass the data in a format required by the encoder. The following lists the requirement for each encoder.

2.4.1. Code128_Uni

This function accept any characters with value between 0 and 255. You can also add special symbols characters, such as FNC1, FNC2, FNC3 and FNC4. In addition to plain characters, you can also use the tilde codes to escape control characters, as below:


When nnn corresponds to a numeric value between 0 and 255, the tilde code sequence represents a character with value equal to nnn. For example, ~d032 represents a space character.


Represents a tilde (~) character.


Represents a FNC1 character. The tilde escape sequence can appear anywhere in the input.


Represents a FNC2 character.


Represents a FNC3 character.


Represents a FNC4 character. FNC4 is used to encode extended ASCII characters. You do not need to enter the FNC4 in most circumstances. Just pass the extended characters you'd like to encode.


Represents a character value from 0 to 26. Replace the X like in the following example ~@ means character 0 (the first character in the ASCII table), ~A means character 1, ~B means character 2, ~C means character 3 and so on.

2.4.2. DataBar Encoding Functions (Except DataBarExpanded)

All databar symbols, except DataBar Expanded, encode a 14-digit number called GTIN. The last digit of GTIN is a modulo 10 checksum, and is not encoded in the barcode. For these functions, you can enter 13 or 14 digits in the DataToEncode parameter. If 14 digits are entered, the last one is discarded.

2.4.3. EAN128_Uni

A structured GS1-128 data is required for the input. Each GS1 data consists of two parts: Application Identifier (AI) and the value. The AI dictates the constraints of value. AI must be enclosed in parentheses in order for the program to correctly parse the input. This program understands most AIs in use. For a complete AI list, see Appendix A, Known GS1-128 AIs.

The input can contain spaces to make the data clear to understand for humans. Spaces are not encoded into barcode. For example, (01)98898765432106 (3202)012345 (15)991231 produces the same barcode as (01)98898765432106(3202)012345(15)991231.

2.4.4. DataBar Expanded

The input requirement of DataBar Expanded encoder is identical to the one for EAN128 function.

In DataBar Expanded, several AI combinations are compressed to reduce the barcode length. You might want to consider them when spaces are a concern. In all these cases, the first digit of the GTIN number must be '9'.

  • Data consisting of only two AI elements: AI 01 followed by AI 3103. For example: (01)90012345678908(3103)001750

  • Data consisting of only two AI elements: AI (01) followed by either 3202 or 3203. For example: (01)90012345678908(3202)000156.

  • Data Consisting of the two or three A1 element strings for A1 01, A1 310x or 320x (x ranging from 0 to 9), and optionally A1 11, 13, 15 or 17. For example (01)98898765432106 (3202)012345(15)991231.

  • Data starting with two element strings A1 01 followed by A1 392x. The A1 392x price may only have from zero to three digits to the right of the decimal point (x = 0 to 3).

  • Data starting with two element strings A1 01 followed by A1 393x. 393x price may only have from zero to three digits to the right of the decimal point (x = 0 to 3). For example (01)90012345678908(3932)0401234.

optimized data (01)98898765432106 (3202)012345 (15)991231non-optimized data. The indicator digit is not '9'. The resulted barcode is about 36% longer.

DataBar Expanded encoder function produces barcode strings for two types of barcodes: GS1 DataBar Expanded and GS1 DataBar Expanded Stacked. GS1 DataBar Expanded is a subset of DataBar Expanded - the number of rows is 1. This function requires you to specify the number of segment per row, which is an even number between 2 and 22. Because GS1 DataBar Expanded can have maximum 22 segments, setting this number to 22 will always produce non-stacked DataBar Expanded barcodes.

By changing SegmentsPerRow value, we can adjust the size of a DataBar Expanded Stacked barcode. Below lists three barcodes with the same data (01)98898765432106 (3202)012345 (15)991231 encoded, but with different SegmentsPerRow values.

Figure 2.1. Barcode Sizes vs. SegmentPerRow

Barcode Sizes vs. SegmentPerRow

Because a DataBar Expanded Stacked barcode can grow vertically, it can encode a large amount of data in small space - a huge advantage over UCC/EAN-128. Not surprisingly, the new coupon format from GS1 is in DataBar Expanded Stacked format (with SegmentsPerRow=6). The barcode below is the new coupon format with (8110)10014141012345290110100 encoded.

[2] Dubbed as GS1 DataBar Sunrise 2010. For more information, see