Zint: Manual

6. Types of symbology

6.1 One-Dimensional Symbols

One-dimensional or linear symbols are what most people associate with the term barcode. They consist of a number of bars and a number of spaces of differing widths.

6.1.1 Code 11

zint -b CODE11 -d "9212320967"

Developed by Intermec in 1977, Code 11 is similar to Code 2 of 5 Matrix and is primarily used in telecommunications. The symbol can encode data consisting of the digits 0-9 and the dash character (-) up to a maximum of 121 characters. Two modulo-11 check digits are added by default. To add just one check digit, set --vers=1 (API option_2 = 1). To add no check digits, set --vers=2 (API option_2 = 2).

6.1.2 Code 2 of 5

Code 2 of 5 is a family of one-dimensional symbols, 8 of which are supported by Zint. Note that the names given to these standards alters from one source to another so you should take care to ensure that you have the right barcode type before using these standards.

6.1.2.1 Standard Code 2 of 5
zint -b C25STANDARD -d "9212320967"

Also known as Code 2 of 5 Matrix, this is a self-checking code used in industrial applications and photo development. Standard Code 2 of 5 will encode numeric input (digits 0-9) up to a maximum of 80 digits. No check digit is added by default. To add a check digit, set --vers=1 (API option_2 = 1). To add a check digit but not show it in the Human Readable Text, set --vers=2 (API option_2 = 2).

6.1.2.2 IATA Code 2 of 5
zint -b C25IATA -d "9212320967"

Used for baggage handling in the air-transport industry by the International Air Transport Agency, this self-checking code will encode numeric input (digits 0-9) up to a maximum of 45 digits. No check digit is added by default. Check digit options are the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.3 Industrial Code 2 of 5
zint -b C25IND -d "9212320967"

Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a maximum of 45 digits. No check digit is added by default. Check digit options are the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.4 Interleaved Code 2 of 5 (ISO 16390)
zint -b C25INTER --compliantheight -d "9212320967"

This self-checking symbology encodes pairs of numbers, and so can only encode an even number of digits (0-9). If an odd number of digits is entered a leading zero is added by Zint. A maximum of 45 pairs (90 digits) can be encoded. No check digit is added by default. Check digit options are the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.5 Code 2 of 5 Data Logic
zint -b C25LOGIC -d "9212320967"

Data Logic does not include a check digit by default and can encode numeric input (digits 0-9) up to a maximum of 80 digits. Check digit options are the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.6 ITF-14
zint -b ITF14 --compliantheight -d "9212320967145"

ITF-14, also known as UPC Shipping Container Symbol or Case Code, is based on Interleaved Code 2 of 5 and requires a 13-digit numeric input (digits 0-9). One modulo-10 check digit is added by Zint.

If no border option is specified Zint defaults to adding a bounding box with a border width of 5. This behaviour can be overridden by using the --bind option (API output_options |= BARCODE_BIND). Similarly the border width can be overridden using --border (API border_width). If a symbol with no border is required this can be achieved by explicitly setting the border type to box (or bind) and leaving the border width 0.

zint -b ITF14 --box --compliantheight -d "9212320967145"
6.1.2.7 Deutsche Post Leitcode
zint -b DPLEIT -d "9212320967145"

Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for mailing purposes. Leitcode requires a 13-digit numerical input and includes a check digit.

6.1.2.8 Deutsche Post Identcode
zint -b DPIDENT -d "91232096712"

Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for mailing purposes. Identcode requires an 11-digit numerical input and includes a check digit.

6.1.3 UPC (Universal Product Code) (ISO 15420)

6.1.3.1 UPC Version A
zint -b UPCA --compliantheight -d "72527270270"

UPC-A is used in the United States for retail applications. The symbol requires an 11-digit article number. The check digit is calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can be added using the + character. For example, to draw a UPC-A symbol with the data 72527270270 with an EAN-5 add-on showing the data 12345 use the command:

zint -b UPCA -d 72527270270+12345

or using the API encode a data string with the + character included:

my_symbol->symbology = BARCODE_UPCA;
error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0);
zint -b UPCA --compliantheight -d "72527270270+12345"

If your input data already includes the check digit symbology BARCODE_UPCA_CHK (35) can be used which takes a 12-digit input and validates the check digit before encoding.

You can adjust the gap between the main symbol and an add-on in multiples of the X-dimension by setting --addongap (API option_2) to a value between 9 (default) and 12. The height in X-dimensions that the guard bars descend below the main bars can be adjusted by setting --guarddescent (API guard_descent) to a value between 0 and 20 (default 5).

6.1.3.2 UPC Version E
zint -b UPCE --compliantheight -d "1123456"

UPC-E is a zero-compressed version of UPC-A developed for smaller packages. The code requires a 6-digit article number (digits 0-9). The check digit is calculated by Zint. EAN-2 and EAN-5 add-on symbols can be added using the + character as with UPC-A. In addition Zint also supports Number System 1 encoding by entering a 7-digit article number stating with the digit 1. For example:

zint -b UPCE -d 1123456

or

my_symbol->symbology = BARCODE_UPCE;
error = ZBarcode_Encode_and_Print(my_symbol, "1123456", 0, 0);

If your input data already includes the check digit symbology BARCODE_UPCE_CHK (38) can be used which takes a 7 or 8-digit input and validates the check digit before encoding.

You can adjust the gap between the main symbol and an add-on in multiples of the X-dimension by setting --addongap (API option_2) to a value between 7 (default) and 12. The height in X-dimensions that the guard bars descend below the main bars can be adjusted by setting --guarddescent (API guard_descent) to a value between 0 and 20 (default 5).

6.1.4 EAN (European Article Number) (ISO 15420)

6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
zint -b EANX --compliantheight -d "4512345678906"

The EAN system is used in retail across Europe and includes standards for EAN-2, EAN-5, EAN-8 and EAN-13 which encode 2, 5, 7 or 12-digit numbers respectively. Zint will decide which symbology to use depending on the length of the input data. In addition EAN-2 and EAN-5 add-on symbols can be added to EAN-8 and EAN-13 symbols using the + character as with UPC symbols. For example:

zint -b EANX -d 54321
zint -b EANX --compliantheight -d "54321"

will encode a stand-alone EAN-5, whereas

zint -b EANX -d 7432365+54321

will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can be achieved using the API:

my_symbol->symbology = BARCODE_EANX;

error = ZBarcode_Encode_and_Print(my_symbol, "54321", 0, 0);

error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321", 0, 0);
zint -b EANX --compliantheight -d "7432365+54321"

All of the EAN symbols include check digits which are added by Zint.

If you are encoding an EAN-8 or EAN-13 symbol and your data already includes the check digit then you can use symbology BARCODE_EANX_CHK (14) which takes an 8 or 13-digit input and validates the check digit before encoding.

Options to adjust the add-on gap and the descent height of guard bars are the same as for 6.1.3.2 UPC Version E.

6.1.4.2 SBN, ISBN and ISBN-13
zint -b ISBNX --compliantheight -d "9789295055124"

EAN-13 symbols (also known as Bookland EAN-13) can also be produced from 9-digit SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant check digit needs to be present in the input data and will be verified before the symbol is generated. In addition EAN-2 and EAN-5 add-on symbols can be added using the + character as with UPC symbols, and there are options to adjust the add-on gap and the descent height of guard bars - see 6.1.3.2 UPC Version E.

6.1.5 Plessey

6.1.5.1 UK Plessey
zint -b PLESSEY -d "C64"

Also known as Plessey Code, this symbology was developed by the Plessey Company Ltd. in the UK. The symbol can encode data consisting of digits (0-9) or letters A-F up to a maximum of 65 characters and includes a CRC check digit.

6.1.5.2 MSI Plessey
zint -b MSI_PLESSEY -d "6502" --vers=2

Based on Plessey and developed by MSE Data Corporation, MSI Plessey has a range of check digit options that are selectable by setting --vers (API option_2). Numeric (digits 0-9) input can be encoded, up to a maximum of 65 digits. The table below shows the options available:

MSI Plessey Check Digit Options
Value Check Digits
0 None
1 Modulo-10 (Luhn)
2 Modulo-10 & Modulo-10
3 Modulo-11 (IBM)
4 Modulo-11 (IBM) & Modulo-10
5 Modulo-11 (NCR)
6 Modulo-11 (NCR) & Modulo-10

To not show the check digit or digits in the Human Readable Text, add 10 to the --vers value. For example --vers=12 (API option_2 = 12) will add two hidden modulo-10 check digits.

6.1.6 Telepen

6.1.6.1 Telepen Alpha
zint -b TELEPEN --compliantheight -d "Z80"

Telepen Alpha was developed by SB Electronic Systems Limited and can encode ASCII text input, up to a maximum of 30 characters. Telepen includes a modulo-127 check digit.

6.1.6.2 Telepen Numeric
zint -b TELEPEN_NUM --compliantheight -d "466X33"

Telepen Numeric allows compression of numeric data into a Telepen symbol. Data can consist of pairs of numbers or pairs consisting of a numerical digit followed an X character. For example: 466333 and 466X33 are valid codes whereas 46X333 is not (the digit pair "X3" is not valid). Up to 60 digits can be encoded. Telepen Numeric includes a modulo-127 check digit which is added by Zint.

6.1.7 Code 39

6.1.7.1 Standard Code 39 (ISO 16388)
zint -b CODE39 --compliantheight -d "1A" --vers=1

Standard Code 39 was developed in 1974 by Intermec. Input data can be up to 85 characters in length and can include the characters 0-9, A-Z, dash (-), full stop (.), space, asterisk (*), dollar ($), slash (/), plus (+) and percent (%). The standard does not require a check digit but a modulo-43 check digit can be added if required by setting --vers=1 (API option_2 = 1).

6.1.7.2 Extended Code 39
zint -b EXCODE39 --compliantheight -d "123.45$@fd"

Also known as Code 39e and Code39+, this symbology expands on Standard Code 39 to provide support for the full 7-bit ASCII character set. The standard does not require a check digit but a modulo-43 check digit can be added if required by setting --vers=1 (API option_2 = 1).

6.1.7.3 Code 93
zint -b CODE93 --compliantheight -d "C93"

A variation of Extended Code 39, Code 93 also supports full ASCII text. Two check characters are added by Zint. By default these check characters are not shown in the Human Readable Text, but may be shown by setting --vers=1 (API option_2 = 1).

6.1.7.4 PZN (Pharmazentralnummer)
zint -b PZN --compliantheight -d "2758089"

PZN is a Code 39 based symbology used by the pharmaceutical industry in Germany. PZN encodes a 7-digit number to which Zint will add a modulo-11 check digit.

6.1.7.5 LOGMARS
zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1

LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a variation of the Code 39 symbology used by the US Department of Defense. LOGMARS encodes the same character set as Standard Code 39. It does not require a check digit but a modulo-43 check digit can be added by setting --vers=1 (API option_2 = 1).

6.1.7.6 Code 32
zint -b CODE32 --compliantheight -d "14352312"

A variation of Code 39 used by the Italian Ministry of Health (“Ministero della Sanità”) for encoding identifiers on pharmaceutical products. This symbology requires a numeric input up to 8 digits in length. A check digit is added by Zint.

6.1.7.7 HIBC Code 39
zint -b HIBC_39 --compliantheight -d "14352312"

This variant adds a leading '+' character and a trailing modulo-49 check digit to a standard Code 39 symbol as required by the Health Industry Barcode standards.

6.1.7.8 Vehicle Identification Number (VIN)
zint -b VIN -d "2FTPX28L0XCA15511" --vers=1

A variation of Code 39 that for vehicle identification numbers used in North America (first character '1' to '5') has a check character verification stage. A 17 character input (0-9, and A-Z excluding 'I', 'O' and 'Q') is required. An invisible Import character prefix 'I' can be added by setting --vers=1 (API option_2 = 1).

6.1.8 Codabar (EN 798)

zint -b CODABAR --compliantheight -d "A37859B"

Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code 27, this symbology was developed in 1972 by Monarch Marketing Systems for retail purposes. The American Blood Commission adopted Codabar in 1977 as the standard symbology for blood identification. Codabar can encode up to 60 characters starting and ending with the letters A-D and containing between these letters the numbers 0-9, dash (-), dollar ($), colon (:), slash (/), full stop (.) or plus (+). No check character is generated by default, but a modulo-16 one can be added by setting --vers=1 (API option_2 = 1). To have the check character appear in the Human Readable Text, set --vers=2 (API option_2 = 2).

6.1.9 Pharmacode

zint -b PHARMA --compliantheight -d "130170"

Developed by Laetus, Pharmacode is used for the identification of pharmaceuticals. The symbology is able to encode whole numbers between 3 and 131070.

6.1.10 Code 128

6.1.10.1 Standard Code 128 (ISO 15417)
zint -b CODE128 --bind -d "130170X178"

One of the most ubiquitous one-dimensional barcode symbologies, Code 128 was developed in 1981 by Computer Identics. This symbology supports full ASCII text and uses a three-mode system to compress the data into a smaller symbol. Zint automatically switches between modes and adds a modulo-103 check digit. Code 128 is the default barcode symbology used by Zint. In addition Zint supports the encoding of ISO/IEC 8859-1 (non-English) characters in Code 128 symbols. The ISO/IEC 8859-1 character set is shown in Appendix A.2 Latin Alphabet No. 1 (ISO/IEC 8859-1).

6.1.10.2 Code 128 Subset B
zint -b CODE128B -d "130170X178"

It is sometimes advantageous to stop Code 128 from using subset mode C which compresses numerical data. The BARCODE_CODE128B variant (symbology 60) suppresses mode C in favour of mode B.

6.1.10.3 GS1-128
zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"

A variation of Code 128 previously known as UCC/EAN-128, this symbology is defined by the GS1 General Specifications. Application Identifiers (AIs) should be entered using [square bracket] notation. These will be converted to parentheses (round brackets) for the Human Readable Text. This will allow round brackets to be used in the data strings to be encoded.

For compatibility with data entry in other systems, if the data does not include round brackets, the option --gs1parens (API input_mode |= GS1PARENS_MODE) may be used to signal that AIs are encased in round brackets instead of square ones.

Fixed length data should be entered at the appropriate length for correct encoding. GS1-128 does not support extended ASCII characters. Check digits for GTIN data AI (01) are not generated and need to be included in the input data. The following is an example of a valid GS1-128 input:

zint -b 16 -d "[01]98898765432106[3202]012345[15]991231"

or using the --gs1parens option:

zint -b 16 --gs1parens -d "(01)98898765432106(3202)012345(15)991231"
6.1.10.4 EAN-14
zint -b EAN14 --compliantheight -d "9889876543210"

A shorter version of GS1-128 which encodes GTIN data only. A 13-digit number is required. The GTIN check digit and AI (01) are added by Zint.

6.1.10.5 NVE-18 (SSCC-18)
zint -b NVE18 --compliantheight -d "37612345000001003"

A variation of Code 128 the ‘Nummer der Versandeinheit’ standard, also known as SSCC-18 (Serial Shipping Container Code), includes both modulo-10 and modulo-103 check digits. NVE-18 requires a 17-digit numerical input. Check digits and AI (00) are added by Zint.

6.1.10.6 HIBC Code 128
zint -b HIBC_128 -d "A123BJC5D6E71"

This option adds a leading '+' character and a trailing modulo-49 check digit to a standard Code 128 symbol as required by the Health Industry Barcode standards.

6.1.10.7 DPD Code
zint -b DPD --compliantheight -d "%000393206219912345678101040"

Another variation of Code 128 as used by DPD (Deutsher Paket Dienst). Requires a 28 character alphanumeric input. Zint formats the Human Readable Text as specified by DPD and adds a modulo-36 check character.

6.1.11 GS1 DataBar (ISO 24724)

Previously known as RSS (Reduced Spaced Symbology), these symbols are due to replace GS1-128 symbols in accordance with the GS1 General Specifications. If a GS1 DataBar symbol is to be printed with a 2D component as specified in ISO/IEC 24723 set --mode=2 (API option_1 = 2). See 6.3 GS1 Composite Symbols (ISO 24723) to find out how to generate DataBar symbols with 2D components.

6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated
zint -b DBAR_OMN --compliantheight -d "0950110153001"

Previously known as RSS-14 this standard encodes a 13-digit item code. A check digit and Application Identifier of (01) are added by Zint. (A 14-digit code that appends the check digit may be given, in which case the check digit will be verified.)

GS1 DataBar Omnidirectional symbols should have a height of 33 or greater. To produce a GS1 DataBar Truncated symbol set the symbol height to a value between 13 and 32. Truncated symbols may not be scannable by omnidirectional scanners.

zint -b DBAR_OMN -d "0950110153001" --height=13
6.1.11.2 GS1 DataBar Limited
zint -b DBAR_LTD --compliantheight -d "0950110153001"

Previously known as RSS Limited this standard encodes a 13-digit item code and can be used in the same way as GS1 DataBar Omnidirectional above. GS1 DataBar Limited, however, is limited to data starting with digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with GS1 DataBar Omnidirectional a check digit and Application Identifier of (01) are added by Zint, and a 14-digit code may be given in which case the check digit will be verified.

6.1.11.3 GS1 DataBar Expanded
zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"

Previously known as RSS Expanded this is a variable length symbology capable of encoding data from a number of AIs in a single symbol. AIs should be encased in [square brackets] in the input data, which will be converted to parentheses (round brackets) before being included in the Human Readable Text attached to the symbol. This method allows the inclusion of parentheses in the data to be encoded. If the data does not include parentheses, the AIs may alternatively be encased in parentheses using the --gs1parens switch. See 6.1.10.3 GS1-128.

GTIN data AI (01) should also include the check digit data as this is not calculated by Zint when this symbology is encoded. Fixed length data should be entered at the appropriate length for correct encoding. The following is an example of a valid GS1 DataBar Expanded input:

zint -b 31 -d "[01]98898765432106[3202]012345[15]991231"

6.1.12 Korea Post Barcode

zint -b KOREAPOST -d "923457"

The Korean Postal Barcode is used to encode a 6-digit number and includes one check digit.

6.1.13 Channel Code

zint -b CHANNEL -d "453678" --compliantheight

A highly compressed symbol for numeric data. The number of channels in the symbol can be between 3 and 8 and this can be specified by setting the value of the --vers option (API option_2). It can also be determined by the length of the input data e.g. a three character input string generates a 4 channel code by default.

The maximum values permitted depend on the number of channels used as shown in the table below:

Channel Maximum Values
Channels Minimum Value Maximum Value
3 00 26
4 000 292
5 0000 3493
6 00000 44072
7 000000 576688
8 0000000 7742862