Zint Barcode Generator and Zint Barcode Studio User Manual

6 Types of Symbology

On this page

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

Developed by Intermec in 1977 for Bell Labs as a high-density barcode to track small telephone components, Code 11 can encode data consisting of the digits 0-9 and the dash character (-) up to a maximum of 140 characters.

zint -b CODE11 -d "9212320967"
Figure 29: zint -b CODE11 -d "9212320967"

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 self-checking symbols, 8 of which are supported by Zint. Note that the names given to these standards alter from one source to another so you should take care to ensure that you have the right barcode type before using them.

6.1.2.1 Standard Code 2 of 5

Also known as Code 2 of 5 Matrix, and used in industrial applications and photo development, Standard Code 2 of 5 will encode numeric input (digits 0-9) up to a maximum of 112 digits.

zint -b C25STANDARD -d "9212320967"
Figure 30: zint -b C25STANDARD -d "9212320967"

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

Used by the International Air Transport Agency (IATA) for baggage handling, this barcode will encode numeric input (digits 0-9) up to a maximum of 80 digits.

zint -b C25IATA -d "9212320967"
Figure 31: zint -b C25IATA -d "9212320967"

No check digit is added by default, but can be set the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.3 Industrial Code 2 of 5

Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a maximum of 79 digits.

zint -b C25IND -d "9212320967"
Figure 32: zint -b C25IND -d "9212320967"

No check digit is added by default, but can be set the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.4 Interleaved Code 2 of 5 (ISO 16390)

A high-density barcode that 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 62 pairs (124 digits) can be encoded.

zint -b C25INTER --compliantheight -d "9212320967"
Figure 33: zint -b C25INTER --compliantheight -d "9212320967"

No check digit is added by default, but can be set the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.5 Code 2 of 5 Data Logic

Data Logic does not include a check digit by default and can encode numeric input (digits 0-9) up to a maximum of 113 digits.

zint -b C25LOGIC -d "9212320967"
Figure 34: zint -b C25LOGIC -d "9212320967"

No check digit is added by default, but can be set the same as for 6.1.2.1 Standard Code 2 of 5.

6.1.2.6 ITF-14

ITF-14, also known as UPC Shipping Container Symbol or Case Code, is based on Interleaved Code 2 of 5 and is designed to encode a GTIN-14. It takes a 13-digit input, which will be prefixed with leading zeroes if less than 13 digits entered, or a 14-digit input if the standard GS1 check digit is given, in which case the check digit will be verified. A standard GS1 check digit is added by Zint unless already given.

zint -b ITF14 --compliantheight -d "9212320967145"
Figure 35: zint -b ITF14 --compliantheight -d "9212320967145"

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 or bindtop) and leaving the border width 0.

zint -b ITF14 --box --compliantheight -d "9212320967145"
Figure 36: zint -b ITF14 --box --compliantheight -d "9212320967145"

6.1.2.7 Deutsche Post Leitcode

Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for routing purposes. Leitcode requires a 13-digit numerical input to which Zint adds a check digit.

zint -b DPLEIT -d "9212320967145"
Figure 37: zint -b DPLEIT -d "9212320967145"

6.1.2.8 Deutsche Post Identcode

Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for identification purposes. Identcode requires an 11-digit numerical input to which Zint adds a check digit.

zint -b DPIDENT -d "91232096712"
Figure 38: zint -b DPIDENT -d "91232096712"

6.1.3 UPC (Universal Product Code) (ISO 15420)

6.1.3.1 UPC Version A

UPC-A is used in the United States for retail applications, and encodes a GTIN-12, a 12-digit Global Trade Item Number that includes a standard GS1 check digit.

zint -b UPCA --compliantheight -d "01234500005"
Figure 39: zint -b UPCA --compliantheight -d "01234500005"

Input up to 11 digits may be given, to which a check digit will be added by Zint. A 12-digit input including the check digit may also be supplied, in which case Zint will verify the check digit, or you may use symbology BARCODE_UPCA_CHK (35), which verifies that the last digit is a check digit. Input less than 11 digits will be zero-filled.

In addition 2-digit and 5-digit add-on symbols can be added, their data separated from the main data by a '+' character or a space. For example, to draw a UPC-A symbol with the data “01234500005” and 5-digit add-on data “12345” use the command:

zint -b UPCA -d "01234500005+12345"

or using the API:

symbol->symbology = BARCODE_UPCA;
/* Using '+' */
error = ZBarcode_Encode_and_Print(symbol, "01234500005+12345", 0, 0);
/* Or a space */
error = ZBarcode_Encode_and_Print(symbol, "01234500005 12345", 0, 0);
zint -b UPCA --compliantheight -d "01234500005+12345"
Figure 40: zint -b UPCA --compliantheight -d "01234500005+12345"

A quiet zone indicator can be added to the HRT by setting --guardwhitespace (API output_options |= EANUPC_GUARD_WHITESPACE). For UPC, this is only relevant when there is an add-on:

zint -b UPCA -d "01234500005+12345" --guardwhitespace

or using the API:

symbol->symbology = BARCODE_UPCA;
symbol->output_options |= EANUPC_GUARD_WHITESPACE;
error = ZBarcode_Encode_and_Print(symbol, "01234500005+12345", 0, 0);
zint -b UPCA --compliantheight -d "01234500005+12345" --guardwhitespace
Figure 41: zint -b UPCA --compliantheight -d "01234500005+12345" --guardwhitespace

You can adjust the gap between the main symbol and an add-on in integral 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.0 and 20.0 (default 5.0).

6.1.3.2 UPC Version E

UPC-E is a zero-compressed version of UPC-A developed for smaller packages, which takes up to 7 digits as input. A standard GS1 check digit will be added by Zint. If 7 digits are given then the first must be ‘0’ or ‘1’ (the latter is known as number system 1 and is non-standard). Input less than 7 digits will be zero-filled.

zint -b UPCE --compliantheight -d "123455"
Figure 42: zint -b UPCE --compliantheight -d "123455"

An 8-digit input including the check digit may also be supplied, in which case Zint will verify the check digit, or the symbology BARCODE_UPCE_CHK (38) may be used, which will verify that the last digit is a check digit before encoding.

As with UPC-A, 2-digit and 5-digit add-on symbols can be added using a '+' character or a space as a separator, and a quiet zone indicator can be added when there is an add-on by setting --guardwhitespace (API output_options |= EANUPC_GUARD_WHITESPACE):

zint -b UPCE -d "123455+12" --guardwhitespace
zint -b UPCE --compliantheight -d "123455+12" --guardwhitespace
Figure 43: zint -b UPCE --compliantheight -d "123455+12" --guardwhitespace

You can adjust the gap between the main symbol and an add-on in integral 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.0 and 20.0 (default 5.0).

6.1.4 EAN (European Article Number) (ISO 15420)

The EAN system, which stands for European Article Number but it is also known as International Article Number, is a backward-compatible extension of UPC, used in retail across Europe and internationally. It defines the symbologies EAN-13, EAN-8 and ISBN (a subset of EAN-13).

6.1.4.1 EAN-13

EAN-13 encodes a GTIN-13, a 13-digit Global Trade Item Number that includes a standard GS1 check digit.

zint -b EAN13 --compliantheight -d "952012345678"
Figure 44: zint -b EAN13 --compliantheight -d "952012345678"

Input up to 12 digits may be given, to which a check digit will be added by Zint, or a 13-digit input can be supplied in which case Zint will validate the check digit. Input less than 12 digits will be zero-filled.

A 2-digit or 5-digit add-on can be added by using a ‘+’ or space character as with UPC symbols. For example:

zint -b EAN13 -d "952012345678+21"

will encode an EAN-13 symbol with a 2-digit add-on. As before these results can be achieved using the API:

symbol->symbology = BARCODE_EAN13;
error = ZBarcode_Encode_and_Print(symbol, "952012345678+21", 0, 0);
zint -b EAN13 --compliantheight -d "952012345678+21"
Figure 45: zint -b EAN13 --compliantheight -d "952012345678+21"

Options to add quiet zone indicators and to adjust the add-on gap and the guard bar descent height are the same as for 6.1.3.2 UPC Version E. For instance:

zint -b EAN13 -d "9520123456788" --guarddescent=2.5 --guardwhitespace
zint -b EAN13 --compliantheight -d "9520123456788" –guarddescent=2.5 –guardwhitespace
Figure 46: zint -b EAN13 --compliantheight -d "9520123456788" –guarddescent=2.5 –guardwhitespace

6.1.4.2 EAN-8

EAN-8 is a shortened version of EAN-13, encoding a GTIN-8 (a GTIN-13 with 5 leading zeroes implied), for use with small packages.

zint -b EAN8 --compliantheight -d "9520000"
Figure 47: zint -b EAN8 --compliantheight -d "9520000"

Input up to 7 digits may be supplied, to which Zint will add a standard GS1 check digit. An 8-digit input including the check digit may also be given, in which case Zint will verify the check digit. Input less than 7 digits will be zero-filled.

Options to add quiet zone indicators and to adjust the guard bar descent height are the same as for 6.1.3.2 UPC Version E. For instance:

zint -b EAN8 -d "9520000" --guardwhitespace

or using the API:

symbol->symbology = BARCODE_EAN8;
symbol->output_options |= EANUPC_GUARD_WHITESPACE;
error = ZBarcode_Encode_and_Print(symbol, "9520000", 0, 0);
zint -b EAN8 --compliantheight -d "9520000" –guardwhitespace
Figure 48: zint -b EAN8 --compliantheight -d "9520000" –guardwhitespace

2-digit and 5-digit add-ons may also be added, and the gap adjusted, as with EAN-13, but this usage is non-standard and Zint will issue a warning on use.

6.1.4.3 ISBN (including SBN and ISBN-13)

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.

zint -b ISBNX --compliantheight -d "9789295055124"
Figure 49: zint -b ISBNX --compliantheight -d "9789295055124"

As with EAN-13, a quiet zone indicator can be added using --guardwhitespace:

zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace
Figure 50: zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace

2-digit and 5-digit add-on symbols can be added using a + or space character, and there are options to adjust the add-on gap and the guard bar descent height - see 6.1.3.2 UPC Version E.

6.1.4.4 EAN/UPC Add-Ons (standalone)

As a convenience, 2-digit and 5-digit add-ons may be generated as standalone symbols using the symbologies BARCODE_EAN_2ADDON (11) and BARCODE_EAN_5ADDON (12).

zint -b EAN_2ADDON --compliantheight -d "12"
Figure 51: zint -b EAN_2ADDON --compliantheight -d "12"

As with the main EAN/UPC symbols a quiet zone indicator can be added using ---guardwhitespace. For instance

zint -b EAN_5ADDON -d "54321" --guardwhitespace

will generate a standalone 5-digit add-on with quiet zone guards, or using the API:

symbol->symbology = BARCODE_EAN_5ADDON;
symbol->output_options |= EANUPC_GUARD_WHITESPACE;
error = ZBarcode_Encode_and_Print(symbol, "54321", 0, 0);
zint -b EAN_5ADDON --compliantheight -d "54321" –guardwhitespace
Figure 52: zint -b EAN_5ADDON --compliantheight -d "54321" –guardwhitespace

6.1.5 Plessey

6.1.5.1 UK Plessey

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 (i.e. hexadecimal digits) up to a maximum of 67 characters.

zint -b PLESSEY -d "C64"
Figure 53: zint -b PLESSEY -d "C64"

The symbol includes two hidden CRC check digits, which may be shown in the Human Readable Text by setting --vers=1 (API option_2 = 1).

6.1.5.2 MSI Plessey

Based on UK Plessey and developed by MSI Data Corporation, MSI Plessey can encode numeric (digits 0-9) input of up to 92 digits.

zint -b MSI_PLESSEY -d "6502" --vers=2
Figure 54: zint -b MSI_PLESSEY -d "6502" --vers=2

MSI Plessey has a range of check digit options that are selectable by setting --vers (API option_2), shown in the table below:

Table 18: MSI Plessey Check Digit Options
ValueCheck Digits
0None
1Modulo-10 (Luhn)
2Modulo-10 & Modulo-10
3Modulo-11 (IBM)
4Modulo-11 (IBM) & Modulo-10
5Modulo-11 (NCR)
6Modulo-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

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

zint -b TELEPEN --compliantheight -d "Z80"
Figure 55: zint -b TELEPEN --compliantheight -d "Z80"

6.1.6.2 Telepen Numeric

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 136 digits can be encoded. Telepen Numeric includes a hidden modulo-127 check digit which is added by Zint.

zint -b TELEPEN_NUM --compliantheight -d "466X33"
Figure 56: zint -b TELEPEN_NUM --compliantheight -d "466X33"

6.1.7 Code 39

6.1.7.1 Standard Code 39 (ISO 16388)

Standard Code 39 was introduced in 1975 by Intermec. Input data can be up to 86 characters in length and can include the characters 0-9, A-Z, dash (-), full stop (.), space, asterisk (*), dollar ($), slash (/), plus (+) and percent (%).

zint -b CODE39 --compliantheight -d "1A" --vers=1
Figure 57: zint -b CODE39 --compliantheight -d "1A" --vers=1

The standard does not require a check digit but a modulo-43 check digit can be added if desired by setting --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.7.2 Extended Code 39

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.

zint -b EXCODE39 --compliantheight -d "123.45#@fd"
Figure 58: zint -b EXCODE39 --compliantheight -d "123.45#@fd"

The check digit options are the same as for 6.1.7.1 Standard Code 39 (ISO 16388).

6.1.7.3 Code 93

A variation of Extended Code 39, Code 93 also supports full ASCII text, accepting up to 123 characters. 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).

zint -b CODE93 --compliantheight -d "C93"
Figure 59: zint -b CODE93 --compliantheight -d "C93"

6.1.7.4 PZN (Pharmazentralnummer)

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 (PZN8). Input less than 7 digits will be zero-filled. An 8-digit input can be supplied in which case Zint will validate the check digit.

zint -b PZN --compliantheight -d "2758089"
Figure 60: zint -b PZN --compliantheight -d "2758089"

To encode a PZN7 (obsolete since 2013) instead set --vers=1 (API option_2 = 1) and supply up to 7 digits. As with PZN8, a modulo-11 check digit will be added or if 7 digits supplied the check digit validated.

6.1.7.5 LOGMARS

LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a variation of the Code 39 symbology used by the U.S. Department of Defense. LOGMARS encodes the same character set as 6.1.7.1 Standard Code 39 (ISO 16388), and the check digit options are also the same. Input is restricted to a maximum of 30 characters.

zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1
Figure 61: zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1

6.1.7.6 Code 32

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.

zint -b CODE32 --compliantheight -d "14352312"
Figure 62: zint -b CODE32 --compliantheight -d "14352312"

6.1.7.7 HIBC Code 39

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.

zint -b HIBC_39 --compliantheight -d "14352312"
Figure 63: zint -b HIBC_39 --compliantheight -d "14352312"

6.1.7.8 Vehicle Identification Number (VIN)

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.

zint -b VIN -d "2FTPX28L0XCA15511" --vers=1
Figure 64: zint -b VIN -d "2FTPX28L0XCA15511" --vers=1

An invisible Import character prefix 'I' can be added by setting --vers=1 (API option_2 = 1).

6.1.8 Codabar (EN 798)

Also known as Rationalized Codabar, Code 27, 2 of 7 Code, NW-7 (Japan), USD-4 and Monarch, this symbology was developed in 1972 from earlier versions by Pitney Bowes-Alpex for retail price marking. The American Blood Commission adopted Codabar in 1979 as the standard barcode for blood products.

zint -b CODABAR --compliantheight -d "A37859B"
Figure 65: zint -b CODABAR --compliantheight -d "A37859B"

Codabar can encode up to 103 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 hidden 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 One-Track

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

zint -b PHARMA --compliantheight -d "130170"
Figure 66: zint -b PHARMA --compliantheight -d "130170"

6.1.10 Code 128

6.1.10.1 Standard Code 128 (ISO 15417)

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-Code Set system to compress the data into a smaller symbol. Zint automatically switches between Code Sets A, B and C (but see below) and adds a hidden modulo-103 check digit.

zint -b CODE128 --bind -d "130170X178"
Figure 67: zint -b CODE128 --bind -d "130170X178"

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 Annex A.2 Latin Alphabet No. 1 (ISO/IEC 8859-1).

Manual switching of Code Sets is possible using the --extraesc option (API input_mode |= EXTRA_ESCAPE_MODE), which apart from processing normal escape sequences also processes the Code 128-specific escapes \^A, \^B, \^C and \^@ (the latter turns off manual Code Set selection). For instance the following will force switching to Code Set B for the data "5678" (normally Code Set C would be used throughout):

zint -b CODE128 -d "1234\^B5678" --extraesc

The manually selected Code Set will apply until the next Code Set escape sequence or until a \^@, with the exception that data that cannot be represented in that Code Set will be switched as appropriate. If the data contains an extra escape sequence, it can be escaped by doubling the caret (^). For instance

zint -b CODE128 -d "\^AABC\^^BDEF" --extraesc

will encode the data "ABC\^BDEF" in Code Set A.

There is also the extra escape \^1, which will encode a special Function Code 1 character (FNC1) anywhere you choose in the data, for instance

zint -b CODE128 -d "A\^1BC\^1DEF" --extraesc

Zint can encode a maximum of 102 symbol characters, which allows for e.g. 202 all-numeric or 101 all-uppercase characters. Sizes above 120 digits (60 alphanumerics) are not recommended.

6.1.10.2 Code 128 Suppress Code Set C (Code Sets A and B only)

It is sometimes advantageous to stop Code 128 from using Code Set C which compresses numerical data. The BARCODE_CODE128AB22 variant (symbology 60) suppresses Code Set C in favour of Code Sets A and B.

zint -b CODE128AB -d "130170X178"
Figure 68: zint -b CODE128AB -d "130170X178"

Note that the special extra escapes mentioned above are not available for this variant (nor for any other).

6.1.10.3 GS1-128

A variation of Code 128 previously known as UCC/EAN-128, this symbology is defined by the GS1 General Specifications. Data should be in one of the formats described in 4.11.3.1 GS1 Data Entry. Here we will use the square bracket format.

zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"
Figure 69: zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"

Fixed length data should be entered at the appropriate length for correct encoding. GS1-128 does not support extended ASCII (ISO/IEC 8859-1) 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 GS1_128 -d "[01]98898765432106[3202]012345[15]991231"

6.1.10.4 EAN-14

A shorter version of GS1-128 which encodes GTIN-14 data only, EAN-14 takes a 13-digit input, which will be prefixed with leading zeroes if less than 13 digits entered, or a 14-digit number if the standard GS1 check digit is given, in which case the check digit will be verified. The GS1 check digit (if not given) and HRT-only AI "(01)" are added by Zint.

zint -b EAN14 --compliantheight -d "9889876543210"
Figure 70: zint -b EAN14 --compliantheight -d "9889876543210"

6.1.10.5 NVE-18 (SSCC-18)

A variation of Code 128 the ‘Nummer der Versandeinheit’ standard, also known as SSCC-18 (Serial Shipping Container Code), includes both a visible standard GS1 check digit and a hidden modulo-103 check digit. NVE-18 takes a 17-digit input, which will be prefixed with leading zeros if less than 17 digits given, or an 18-digit input if the GS1 check digit is included, in which case the check digit will be verified. Check digit(s) and HRT-only AI "(00)" are added by Zint.

zint -b NVE18 --compliantheight -d "37612345000001003"
Figure 71: zint -b NVE18 --compliantheight -d "37612345000001003"

6.1.10.6 HIBC Code 128

This variation 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.

zint -b HIBC_128 -d "A123BJC5D6E71"
Figure 72: zint -b HIBC_128 -d "A123BJC5D6E71"

6.1.10.7 DPD Code

Another variation of Code 128 as used by DPD (Deutscher Paketdienst).

zint -b DPD --compliantheight -d "000393206219912345678101040"
Figure 73: zint -b DPD --compliantheight -d "000393206219912345678101040"

DPD Code requires a 27 or 28 character input. For 28 character input, the first character is an identification tag (Barcode ID), which should usually be "%" (ASCII 37). If 27 characters are supplied, "%" will be prefixed by Zint (except if marked as a “relabel”, see below). The rest of the 27-character input must be alphanumeric, and is of the form:

Table 19: DPD Input Fields
Destination Post CodeTracking NumberService CodeDestination Country Code
PPPPPPP (7 alphanumerics)TTTTTTTTTTTTTT (14 alphanumerics)SSS (3 digits)CCC (3-digit ISO 3166-1)

A warning will be generated if the Service Code, the Destination Country Code, or the last 10 characters of the Tracking Number are non-numeric.

Zint formats the Human Readable Text as specified by DPD, leaving out the identification tag, and adds a modulo-36 check character to the text (not to the barcode itself), thus:

PPPP PPP TTTT TTTT TTTT TT SSS CCC D

By default a top boundary bar is added, with default width 3X. The width can be overridden using --border (API border_width). For a symbol with no top boundary bar, explicitly set the border type to bindtop (or bind or box) and leave the border width 0.

A DPD Code can be marked as a “relabel” by specifying --vers=1 (API option_2 = 1), which omits the identification tag and prints the barcode at half height. In this case, an input of 27 alphanumeric characters is required.

6.1.10.8 UPU S10

The Universal Postal Union S10 variant of Code 128 encodes 13 characters in the format "SSNNNNNNNNXCC", where "SS" is a two-character alphabetic service indicator, "NNNNNNNN" is an 8-digit serial number, "X" is a modulo-11 check digit, and "CC" is a two-character ISO 3166-1 country code.

zint -b UPU_S10 --compliantheight -d "EE876543216CA"
Figure 74: zint -b UPU_S10 --compliantheight -d "EE876543216CA"

The check digit may be omitted in which case Zint will add it. Warnings will be generated if the service indicator is non-standard or the country code is not ISO 3361-1.

6.1.11 GS1 DataBar (ISO 24724)

Previously known as RSS (Reduced Spaced Symbology), these symbols were introduced in 2006 by GS1 to efficiently encode GS1 data. Stacked counterparts (apart from GS1 DataBar Limited) are also available - see 6.2.7 GS1 DataBar Stacked (ISO 24724).

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

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

zint -b DBAR_OMN --compliantheight -d "0950110153001"
Figure 75: zint -b DBAR_OMN --compliantheight -d "0950110153001"

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
Figure 76: zint -b DBAR_OMN -d "0950110153001" --height=13

6.1.11.2 GS1 DataBar Limited

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 HRT-only 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. Input less than 13 digits will be zero-filled.

zint -b DBAR_LTD --compliantheight -d "0950110153001"
Figure 77: zint -b DBAR_LTD --compliantheight -d "0950110153001"

6.1.11.3 GS1 DataBar Expanded

Previously known as RSS Expanded this is a variable length symbology capable of encoding multiple AIs in a single symbol. Data should be in one of the formats described in 4.11.3.1 GS1 Data Entry, and will be displayed using parentheses (round brackets) in the Human Readable Text.

zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"
Figure 78: zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"

The GTIN-14 data for AI (01) must include the standard GS1 check digit as this is not calculated by Zint when this symbology is encoded. Data for fixed-length AIs must be entered at the appropriate length. The maximum capacity is 74 numerics or 41 alphanumerics. The following is an example of a valid GS1 DataBar Expanded input:

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

6.1.12 Korea Post Barcode

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

zint -b KOREAPOST -d "923457"
Figure 79: zint -b KOREAPOST -d "923457"

6.1.13 Channel Code

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.

zint -b CHANNEL -d "453678" --compliantheight
Figure 80: zint -b CHANNEL -d "453678" --compliantheight

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

Table 20: Channel Value Ranges
ChannelsMinimum ValueMaximum Value
30026
4000292
500003493
60000044072
7000000576688
800000007742862

6.1.14 BC412 (SEMI T1-95)

Designed by IBM for marking silicon wafers, each BC412 character is represented by 4 bars of a single size, interleaved with 4 spaces of varying sizes that total 8 (hence 4 bars in 12). Zint implements the SEMI T1-95 standard, where input must be alphanumeric, excluding the letter O, and must be from 7 to 18 characters in length. A single check character is added by Zint, appearing in the 2nd character position. Lowercase input is automatically made uppercase.

zint -b BC412 -d "AQ45670" --compliantheight
Figure 81: zint -b BC412 -d "AQ45670" --compliantheight

6.2 Stacked Symbologies

6.2.1 Basic Symbol Stacking

An early innovation to get more information into a symbol, used primarily in the vehicle industry, is to simply stack one-dimensional codes on top of each other. This can be achieved at the command prompt by giving more than one set of input data. For example

zint -d "This" -d "That"

will draw two Code 128 symbols, one on top of the other. The same result can be achieved using the API by executing the ZBarcode_Encode() function more than once on a symbol. For example:

symbol->symbology = BARCODE_CODE128;
error = ZBarcode_Encode(symbol, "This", 0);
error = ZBarcode_Encode(symbol, "That", 0);
error = ZBarcode_Print(symbol);
zint -d "This" -d "That"
Figure 82: zint -d "This" -d "That"

Note that the Human Readable Text will be that of the last data, so it’s best to use the option --notext (API show_hrt = 0).

The stacked barcode rows can be separated by row separator bars by specifying --bind (API output_options |= BARCODE_BIND). The height of the row separator bars in integral multiples of the X-dimension (minimum and default 1, maximum 4) can be set by --separator (API option_3):

zint --bind --notext --separator=2 -d "This" -d "That"
zint --notext --bind --separator=2 -d "This" -d "That"
Figure 83: zint --notext --bind --separator=2 -d "This" -d "That"

A more sophisticated method is to use some type of line indexing which indicates to the barcode reader which order the stacked symbols should be read in. This is demonstrated by the symbologies below.

6.2.2 Codablock F

This is a stacked symbology based on Code 128 which can encode Latin-1 data up to a maximum length of 2726 symbol characters, meaning for instance up to 2726 all ASCII characters, or 5452 all numeric, or up to 1363 all extended ASCII (ISO/IEC 8859-1).

zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3
Figure 84: zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3

The width of the Codablock F symbol can be set using the --cols option (API option_2), to a value between 9 and 67. The height (number of rows) can be set using the --rows option (API option_1), with a maximum of 44. Zint does not currently support encoding of GS1 data in Codablock F symbols.

A separate symbology ID (BARCODE_HIBC_BLOCKF) can be used to encode Health Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49 check digit to the encoded data.

6.2.3 Code 16K (EN 12323)

Code 16K, invented by Ted Williams for LaserLight Systems in 1988, uses a Code 128 based system which can stack up to 16 fixed-width rows in a block. This gives a maximum data capacity of 77 characters or 154 numerical digits and includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1 character encoding in the same manner as Code 128. GS1 data encoding is also supported. The minimum number of rows to use can be set using the --rows option (API option_1), with values from 2 to 16.

zint -b CODE16K --compliantheight -d "ab0123456789"
Figure 85: zint -b CODE16K --compliantheight -d "ab0123456789"

6.2.4 PDF417 (ISO 15438)

Heavily used in the parcel industry, the PDF417 symbology can encode a large amount of data into a small space. Zint supports encoding up to the ISO standard maximum symbol size of 925 codewords which (at error correction level 0) allows a maximum data size of 1850 text characters, or 2710 digits.

zint -b PDF417 -d "PDF417"
Figure 86: zint -b PDF417 -d "PDF417"

The width of the generated PDF417 symbol can be specified at the command line using the --cols switch (API option_2) followed by a number between 1 and 30, the number of rows using the --rows switch (API option_3) followed by a number between 3 and 90, and the amount of error correction information can be specified by using the --secure switch (API option_1) followed by a number between 0 and 8 where the number of codewords used for error correction is determined by 2^(value + 1). The default level of error correction is determined by the amount of data being encoded.

This symbology uses Latin-1 character encoding by default but also supports the ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_PDF) can be used to encode Health Industry Barcode (HIBC) data.

For a faster but less optimal encodation, the --fast option (API input_mode |= FAST_MODE) may be used.

PDF417 supports Structured Append of up to 99,999 symbols and an optional numeric ID of up to 30 digits, which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The ID consists of up to 10 triplets, each ranging from "000" to "899". For instance "123456789" would be a valid ID of 3 triplets. However "123456900" would not, as the last triplet "900" exceeds "899". The triplets are 0-filled, for instance "1234" becomes "123004". If an ID is not given, no ID is encoded.

6.2.5 Compact PDF417 (ISO 15438)

Previously known as Truncated PDF417, Compact PDF417 omits some per-row overhead to produce a narrower but less robust symbol. Options are the same as for PDF417 above.

zint -b PDF417COMP -d "PDF417"
Figure 87: zint -b PDF417COMP -d "PDF417"

6.2.6 MicroPDF417 (ISO 24728)

A variation of the PDF417 standard, MicroPDF417 is intended for applications where symbol size needs to be kept to a minimum. Its size ranges over 1 - 4 data columns and 4 - 44 rows. The maximum amount a MicroPDF417 symbol can hold is 250 alphanumeric characters or 366 digits. The amount of error correction used is dependent on symbol size. The number of data columns used can be determined using the --cols switch (API option_2) as with PDF417. The amount of data determines the number of rows.

zint -b MICROPDF417 -d "12345678"
Figure 88: zint -b MICROPDF417 -d "12345678"

MicroPDF417 uses Latin-1 character encoding by default but also supports the ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_MICPDF) can be used to encode Health Industry Barcode (HIBC) data.

FAST_MODE and Structured Append are supported the same as for PDF417, for which see details.

6.2.7 GS1 DataBar Stacked (ISO 24724)

The following are stacked counterparts of those in 6.1.11 GS1 DataBar (ISO 24724), GS1 DataBar Limited excluded.

See 6.3 GS1 Composite Symbols (ISO 24723) to find out how to generate DataBar Stacked symbols with 2D components.

6.2.7.1 GS1 DataBar Stacked

A stacked variation of the GS1 DataBar Truncated symbol requiring the same input (see 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated), this symbol is the same as the following GS1 DataBar Stacked Omnidirectional symbol except that its height is reduced and its central separator is a single row, making it suitable for small items when omnidirectional scanning is not required.

zint -b DBAR_STK --compliantheight -d "9889876543210"
Figure 89: zint -b DBAR_STK --compliantheight -d "9889876543210"

6.2.7.2 GS1 DataBar Stacked Omnidirectional

A stacked variation of the GS1 DataBar Omnidirectional symbol requiring the same input (see 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated). The data is encoded in two rows of bars with a central 3-row separator.

zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"
Figure 90: zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"

6.2.7.3 GS1 DataBar Expanded Stacked

A stacked variation of the GS1 DataBar Expanded symbol for smaller packages. Input is the same as for GS1 DataBar Expanded (see 6.1.11.3 GS1 DataBar Expanded), with the same maximum capacity.

zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"
Figure 91: zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"

The width of the symbol can be altered using the --cols switch (API option_2). In this case the number of columns (values 1 to 11) relates to the number of character pairs on each row of the symbol. Alternatively the --rows switch (API option_3) can be used to specify the maximum number of rows (values 2 to 11), and the number of columns will be adjusted accordingly.

If generated with a 2D component (6.3 GS1 Composite Symbols (ISO 24723)), the number of columns must be at least 2.

6.2.8 Code 49

Developed in 1987 at Intermec, Code 49 is a cross between UPC and Code 39. It is one of the earliest stacked symbologies and influenced the design of Code 16K a year later. It supports full 7-bit ASCII input up to a maximum of 49 characters or 81 numeric digits. GS1 data encoding is also supported. The minimum number of fixed-width rows to use can be set using the --rows option (API option_1), with values from 2 to 8.

zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"
Figure 92: zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"

6.3 GS1 Composite Symbols (ISO 24723)

GS1 Composite symbols employ a mixture of components to give more comprehensive information about a product. The permissible contents of a composite symbol is determined by the terms of the GS1 General Specifications. Composite symbols consist of a linear component which can be an EAN, UPC, GS1-128 or GS1 DataBar symbol, a two-dimensional (2D) component which is based on PDF417 or MicroPDF417, and a separator pattern. The type of linear component to be used is determined using the -b or --barcode switch (API symbology) as with other encoding methods. Valid values are shown below.

Table 21: GS1 Composite Symbology Values
Numeric ValueNameBarcode Name
131BARCODE_GS1_128_CCGS1 Composite Symbol with GS1-128 linear component
132BARCODE_DBAR_OMN_CCGS1 Composite Symbol with GS1 DataBar Omnidirectional linear component
133BARCODE_DBAR_LTD_CCGS1 Composite Symbol with GS1 DataBar Limited linear component
134BARCODE_DBAR_EXP_CCGS1 Composite Symbol with GS1 DataBar Expanded linear component
135BARCODE_UPCA_CCGS1 Composite Symbol with UPC-A linear component
136BARCODE_UPCE_CCGS1 Composite Symbol with UPC-E linear component
137BARCODE_DBAR_STK_CCGS1 Composite Symbol with GS1 DataBar Stacked component
138BARCODE_DBAR_OMNSTK_CCGS1 Composite Symbol with GS1 DataBar Stacked Omnidirectional component
139BARCODE_DBAR_EXPSTK_CCGS1 Composite Symbol with GS1 DataBar Expanded Stacked component
148BARCODE_EAN8_CCGS1 Composite Symbol with EAN-8 linear component
149BARCODE_EAN13_CCGS1 Composite Symbol with EAN-13 linear component

The data to be encoded in the linear component of a composite symbol should be entered into a primary string with the data for the 2D component being entered in the normal way. To do this at the command prompt use the --primary switch (API primary). For example:

zint -b EAN13_CC --mode=1 --primary=331234567890 -d "[99]1234-abcd"

This creates an EAN-13 linear component with the data "331234567890" and a 2D CC-A (see below) component with the data "(99)1234-abcd". The same results can be achieved using the API as shown below:

symbol->symbology = BARCODE_EAN13_CC;
symbol->option_1 = 1;
strcpy(symbol->primary, "331234567890");
ZBarcode_Encode_and_Print(symbol, "[99]1234-abcd", 0, 0);

2-digit and 5-digit add-on data can be used with EAN and UPC symbols using the '+' character as described in sections 6.1.3 UPC (Universal Product Code) (ISO 15420) and 6.1.4 EAN (European Article Number) (ISO 15420).

The 2D component of a composite symbol can use one of three systems: CC-A, CC-B and CC-C, as described below. The 2D component type can be selected automatically by Zint dependent on the length of the input string. Alternatively the three methods can be accessed using the --mode prompt (API option_1) followed by 1, 2 or 3 for CC-A, CC-B or CC-C respectively.

6.3.1 CC-A

This system uses a variation of MicroPDF417 which is optimised to fit into a small space. The size of the 2D component and the amount of error correction is determined by the amount of data to be encoded and the type of linear component which is being used. CC-A can encode up to 56 numeric digits (including AIs) or an alphanumeric string of shorter length (e.g. if all capitals, at most 30, excluding AI). To select CC-A use --mode=1 (API option_1 = 1).

zint -b EAN13_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890
Figure 93: zint -b EAN13_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890

6.3.2 CC-B

This system uses MicroPDF417 to encode the 2D component. The size of the 2D component and the amount of error correction is determined by the amount of data to be encoded and the type of linear component which is being used. CC-B can encode up to 338 numeric digits or an alphanumeric string of shorter length. To select CC-B use --mode=2 (API option_1 = 2).

zint -b EAN13_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890
Figure 94: zint -b EAN13_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890

6.3.3 CC-C

This system uses PDF417 and can only be used in conjunction with a GS1-128 linear component. CC-C can encode up to 2361 numeric digits or an alphanumeric string of shorter length. To select CC-C use --mode=3 (API option_1 = 3).

zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"
Figure 95: zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"

6.4 Two-Track Symbols

6.4.1 Pharmacode Two-Track

Developed by Laetus, Pharmacode Two-Track is an alternative system to Pharmacode One-Track (see 6.1.9 Pharmacode One-Track) used for the identification of pharmaceuticals. The symbology is able to encode whole numbers between 4 and 64570080.

zint -b PHARMA_TWO --compliantheight -d "29876543"
Figure 96: zint -b PHARMA_TWO --compliantheight -d "29876543"

6.4.2 POSTNET

Used by the United States Postal Service until 2009, the POSTNET barcode was used for encoding zip-codes on mail items. POSTNET uses numerical input data and includes a modulo-10 check digit. While Zint will encode POSTNET symbols of up to 38 digits in length, standard lengths as used by USPS were PostNet6 (5-digit ZIP input), PostNet10 (5-digit ZIP + 4-digit user data) and PostNet12 (5-digit ZIP + 6-digit user data), and a warning will be issued if the input length is not one of these.

zint -b POSTNET --compliantheight -d "12345678901"
Figure 97: zint -b POSTNET --compliantheight -d "12345678901"

6.4.3 PLANET

Used by the United States Postal Service until 2009, the PLANET (Postal Alpha Numeric Encoding Technique) barcode was used for encoding routing data on mail items. PLANET uses numerical input data and includes a modulo-10 check digit. While Zint will encode PLANET symbols of up to 38 digits in length, standard lengths used by USPS were Planet12 (11-digit input) and Planet14 (13-digit input), and as with POSTNET a warning will be issued if the length is not one of these.

zint -b PLANET --compliantheight -d "4012345235636"
Figure 98: zint -b PLANET --compliantheight -d "4012345235636"

6.4.4 Brazilian CEPNet

Based on POSTNET, the CEPNet symbol is used by Correios, the Brazilian postal service, to encode CEP (Código de Endereçamento Postal) numbers on mail items. Input should consist of eight digits with the check digit being automatically added by Zint.

zint -b CEPNET --compliantheight -d "12345678"
Figure 99: zint -b CEPNET --compliantheight -d "12345678"

6.4.5 DX Film Edge Barcode

Introduced by Kodak in the 1980s, the DX (Digital Index) barcode is printed on the bottom edge of 35mm film to aid in the reordering and post-processing of prints.

zint -b DXFILMEDGE --compliantheight -d "112-1/10A"
Figure 100: zint -b DXFILMEDGE --compliantheight -d "112-1/10A"

The data can be in two parts. The first part (required) is the “DX number”, identifying the manufacturer and film type - the National Association of Photographic Manufacturers (NAPM) number. The second part, which is optional and if present is separated from the first by a slash (/), gives the frame number.

The DX number is in either of two formats. The first format is a number of 1 to 4 digits (“DX Extract”) or 6 digits (“DX Full”), but for the 6-digit version the first and last digit are ignored, leaving a 4-digit DX Extract number in any case, which must be in the range 16 to 2047. The second format "NNN-NN" represents the DX Extract as two numbers separated by a dash (-), the first number being 1 to 3 digits (range 1 to 127) and the second 1 to 2 digits (range 0 to 15).23

The optional frame number is a number in the range 0 to 63, and may have a half frame indicator "A" appended. Special character sequences (with or without a half frame indicator appended) may also be used: "S" or "X" means frame number 62, "K" or "00" means frame number 63, and "F" means frame number 0.

A parity bit is automatically added by Zint.

6.5 4-State Postal Codes

6.5.1 Australia Post 4-State Symbols

6.5.1.1 Customer Barcodes

Australia Post Standard Customer Barcode, Customer Barcode 2 and Customer Barcode 3 are 37-bar, 52-bar and 67-bar specifications respectively, developed by Australia Post for printing Delivery Point ID (DPID) and customer information on mail items.

zint -b AUSPOST --compliantheight -d "96184209"
Figure 101: zint -b AUSPOST --compliantheight -d "96184209"

Valid data characters are 0-9, A-Z, a-z, space and hash (#). A Format Control Code (FCC) is added by Zint and should not be included in the input data. Reed-Solomon error correction data is generated by Zint. Encoding behaviour is determined by the length of the input data according to the formula shown in the following table.

Table 22: Australia Post Input Formats
Input LengthRequired Input FormatSymbol LengthFCCEncoding Table
89999999937-bar11None
1399999999AAAAA52-bar59C
16999999999999999952-bar59N
1899999999AAAAAAAAAA67-bar62C
239999999999999999999999967-bar62N

6.5.1.2 Reply Paid Barcode

A Reply Paid version of the Australia Post 4-State Barcode (FCC 45) which requires an 8-digit DPID input.

zint -b AUSREPLY --compliantheight -d "12345678"
Figure 102: zint -b AUSREPLY --compliantheight -d "12345678"

6.5.1.3 Routing Barcode

A Routing version of the Australia Post 4-State Barcode (FCC 87) which requires an 8-digit DPID input.

zint -b AUSROUTE --compliantheight -d "34567890"
Figure 103: zint -b AUSROUTE --compliantheight -d "34567890"

6.5.1.4 Redirect Barcode

A Redirection version of the Australia Post 4-State Barcode (FCC 92) which requires an 8-digit DPID input.

zint -b AUSREDIRECT --compliantheight -d "98765432"
Figure 104: zint -b AUSREDIRECT --compliantheight -d "98765432"

6.5.2 Dutch Post KIX Code

This symbology is used by Royal Dutch TPG Post (Netherlands) for Postal code and automatic mail sorting. Data input can consist of numbers 0-9 and letters A-Z and needs to be 11 characters in length. No check digit is included.

zint -b KIX --compliantheight -d "2500GG30250"
Figure 105: zint -b KIX --compliantheight -d "2500GG30250"

6.5.3 Royal Mail 4-State Customer Code (RM4SCC)

The RM4SCC standard is used by the Royal Mail in the UK to encode postcode and customer data on mail items. Data input can consist of numbers 0-9 and letters A-Z and usually includes delivery postcode followed by house number. For example "W1J0TR01" for 1 Piccadilly Circus in London. Check digit data is generated by Zint.

zint -b RM4SCC --compliantheight -d "W1J0TR01"
Figure 106: zint -b RM4SCC --compliantheight -d "W1J0TR01"

6.5.4 Royal Mail 4-State Mailmark

Developed in 2014 as a replacement for RM4SCC this 4-state symbol includes Reed- Solomon error correction.

zint -b MAILMARK_4S --compliantheight -d "21B2254800659JW5O9QA6Y"
Figure 107: zint -b MAILMARK_4S --compliantheight -d "21B2254800659JW5O9QA6Y"

Input is a pre-formatted alphanumeric string of 22 (for Barcode C) or 26 (for Barcode L) characters, producing a symbol with 66 or 78 bars respectively. The rules for the input data are complex, as summarized in the following table.

Table 23: Royal Mail 4-State Mailmark Input Fields
FormatVersion IDClassSupply Chain IDItem IDDestination+DPS
1 digit (0-4)1 digit (0-3)1 alphanum. (0-9A-E)2 digits (C) or 6 digits (L)8 digits9 alphanumerics (1 of 6 patterns)

The 6 Destination+DPS (Destination Post Code plus Delivery Point Suffix) patterns are:

Table 24: Royal Mail 4-State Mailmark Destination+DPS Patterns
ANNLLNLSSAANNLLNLSANNNLLNLSAANNNLLNLANANLLNLSAANANLLNL

where 'A' stands for full alphabetic (A-Z), 'L' for limited alphabetic (A-Z less 'CIKMOV'), 'N' for numeric (0-9), and 'S' for space.

Four of the permitted patterns include a number of trailing space characters - these will be appended by Zint if not included in the input data. A special fixed string "XY11 " (5 trailing spaces, inclusion optional) designates an international destination.

For the two-dimensional Data Matrix-based version, see 6.6.2 Royal Mail 2D Mailmark (CMDM) (Data Matrix).

6.5.5 USPS Intelligent Mail

Also known as the OneCode barcode and used in the U.S. by the United States Postal Service (USPS), the Intelligent Mail system replaced the POSTNET and PLANET symbologies in 2009.

zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"
Figure 108: zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"

Intelligent Mail is a fixed length (65-bar) symbol which combines routing and customer information in a single symbol. Input data consists of a 20-digit tracking code, followed by a dash (-), followed by a delivery point zip-code which can be 0, 5, 9 or 11 digits in length. For example all of the following inputs are valid data entries:

  • "01234567094987654321"
  • "01234567094987654321-01234"
  • "01234567094987654321-012345678"
  • "01234567094987654321-01234567891"

6.5.6 Japanese Postal Code

Used for address data on mail items for Japan Post. Accepted values are 0-9, A-Z and dash (-). A modulo 19 check digit is added by Zint.

zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"
Figure 109: zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"

6.5.7 DAFT Code

This is a method for creating 4-state codes where the data encoding is provided by an external program. Input data should consist of the letters 'D', 'A', 'F' and 'T' where these refer to descender, ascender, full (ascender and descender) and tracker (neither ascender nor descender) respectively. All other characters are invalid.

zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256
Figure 110: zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256

The ratio of the tracker size to full height can be given in thousandths (permille) using the --vers option (API option_2). The default value is 250 (25%).

For example the following

zint -b DAFT -d AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF --height=8.494 --vers=256

produces the same barcode (see 6.5.3 Royal Mail 4-State Customer Code (RM4SCC)) as

zint -b RM4SCC --compliantheight -d "W1J0TR01"

6.6 Matrix Symbols

6.6.1 Data Matrix (ISO 16022)

Also known as Semacode this symbology was developed in 1989 by Acuity CiMatrix in partnership with the U.S. DoD and NASA. The symbol can encode a large amount of data in a small area.

zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square
Figure 111: zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square

Data Matrix encodes characters in the Latin-1 set by default but also supports encoding in other character sets using the ECI mechanism. It can also encode GS1 data. The size of the generated symbol can be adjusted using the --vers option (API option_2) as shown in the table below. A separate symbology ID (BARCODE_HIBC_DM) can be used to encode Health Industry Barcode (HIBC) data. Note that only ECC 200 symbols are supported, the older standards (ECC 000 to 140) have now been removed from Zint.

Table 25: Data Matrix Sizes
InputSymbol SizeInputSymbol SizeInputSymbol Size
110 x 101136 x 3621104 x 104
212 x 121240 x 4022120 x 120
314 x 141344 x 4423132 x 132
416 x 161448 x 4824144 x 144
518 x 181552 x 52258 x 18
620 x 201664 x 64268 x 32
722 x 221772 x 722712 x 26
824 x 241880 x 802812 x 36
926 x 261988 x 882916 x 36
1032 x 322096 x 963016 x 48

The largest version 24 (144 x 144) can encode 3116 digits, around 2335 alphanumeric characters, or 1555 bytes of data.

When using automatic symbol sizes you can force Zint to use square symbols (versions 1-24) at the command line by using the option --square (API option_3 = DM_SQUARE).

Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be generated with the following values as before:

Table 26: DMRE Sizes
InputSymbol SizeInputSymbol Size
318 x 484020 x 36
328 x 644120 x 44
338 x 804220 x 64
348 x 964322 x 48
358 x 1204424 x 48
368 x 1444524 x 64
3712 x 644626 x 40
3812 x 884726 x 48
3916 x 644826 x 64

DMRE symbol sizes may be activated in automatic size mode using the option --dmre (API option_3 = DM_DMRE).

GS1 data may be encoded using FNC1 (default) or GS (Group Separator, ASCII 29) as separator. Use the option --gssep to change to GS (API output_options |= GS1_GS_SEPARATOR).

By default Zint uses a “de facto” codeword placement for symbols of size 144 x 144 (version 24). To override this and use the now clarified ISO/IEC standard placement, use option --dmiso144 (API option_3 |= DM_ISO_144).

For a faster but less optimal encodation, the --fast option (API input_mode |= FAST_MODE) may be used.

Data Matrix supports Structured Append of up to 16 symbols and a numeric ID (file identifications), which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The ID consists of 2 numbers ID1 and ID2, each of which can range from 1 to 254, and is specified as the single number ID1 * 1000 + ID2, so for instance ID1 "123" and ID2 "234" would be given as "123234". Note that both ID1 and ID2 must be non-zero, so e.g. "123000" or "000123" would be invalid IDs. If an ID is not given it defaults to "001001".

6.6.2 Royal Mail 2D Mailmark (CMDM) (Data Matrix)

zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30
Figure 112: zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30

This variant of Data Matrix, also known as “Complex Mail Data Mark” (CMDM), was introduced by Royal Mail along with 6.5.4 Royal Mail 4-State Mailmark, and offers space for customer data following an initial pre-formatted 45 character section, as summarized below.

Table 27: Royal Mail 2D Mailmark Input Fields
Field NameLengthValues
UPU Country ID4"JGB "
Information Type1Alphanumeric
Version ID1"1"
Class1Alphanumeric
Supply Chain ID7Numeric
Item ID8Numeric
Destination+DPS9Alphanumeric (1 of 13 patterns)
Service Type1Numeric
RTS Post Code7Alphanumeric (1 of 7 patterns)
Reserved6Spaces
Customer Data6, 45 or 29Anything (Latin-1)

The 12 Destination+DPS (Destination Post Code plus Delivery Point Suffix) patterns are similar to those for the 4-state except that the alphabetic limitation ('L' versus 'A') does not apply, only the initial “outward” part is required (the rest can be blank), and the whole field can be blank:

Table 28: Royal Mail 2D Mailmark Destination+DPS Patterns
ANNAANASSAANNAANASANNNAANASAANNNAANAANANAANASAANANAANA
ANSSSSSSSAANSSSSSSANNSSSSSSAANNSSSSSANASSSSSSAANASSSSS

where 'A' is alphabetic (A-Z), 'N' numeric (0-9), and 'S' space.

The 6 RTS (Return to Sender) Post Code patterns are similar to above except without the DPS ('NA'), and the trailing “inward” part cannot be blank (although the whole field can be):

Table 29: Royal Mail 2D Mailmark RTS Patterns
ANNAASSAANNAASANNNAASAANNNAAANANAASAANANAA

Three sizes are defined, one rectangular, with varying maximum amounts of optional customer data:

Table 30: Royal Mail 2D Mailmark Sizes
NameSizeCustomer DataZint Version
Type 724 x 246 characters8
Type 932 x 3245 characters10
Type 2916 x 4829 characters30

Zint will automatically select a size based on the amount of customer data, or it can be specified using the --vers option (API option_2), which takes the Zint version number (one more than the Royal Mail Type number). Zint will prefix the input data with "JGB " if it’s missing, and also space-pad the input if the customer data is absent or falls short. As with Data Matrix, the rectangular symbol Type 29 can be excluded from automatic size selection by using the option --square (API option_3 = DM_SQUARE).

GS1 data, the ECI mechanism, and Structured Append are not supported.

6.6.3 QR Code (ISO 18004)

Also known as Quick Response Code this symbology was developed by Denso.

zint -b QRCODE -d "QR Code Symbol" --mask=5
Figure 113: zint -b QRCODE -d "QR Code Symbol" --mask=5

Four levels of error correction are available using the --secure option (API option_1) as shown in the following table.

Table 31: QR Code ECC Levels
InputECC LevelError Correction CapacityRecovery Capacity
1LApprox 20% of symbolApprox 7%
2MApprox 37% of symbolApprox 15%
3QApprox 55% of symbolApprox 25%
4HApprox 65% of symbolApprox 30%

The size of the symbol can be specified by setting the --vers option (API option_2) to the QR Code version required (1-40). The size of symbol generated is shown in the table below.

Table 32: QR Code Sizes
InputSymbol SizeInputSymbol SizeInputSymbol Size
121 x 211577 x 7729133 x 133
225 x 251681 x 8130137 x 137
329 x 291785 x 8531141 x 141
433 x 331889 x 8932145 x 145
537 x 371993 x 9333149 x 149
641 x 412097 x 9734153 x 153
745 x 4521101 x 10135157 x 157
849 x 4922105 x 10536161 x 161
953 x 5323109 x 10937165 x 165
1057 x 5724113 x 11338169 x 169
1161 x 6125117 x 11739173 x 173
1265 x 6526121 x 12140177 x 177
1369 x 6927125 x 125
1473 x 7328129 x 129

The maximum capacity of a QR Code symbol (version 40) is 7089 numeric digits, 4296 alphanumeric characters or 2953 bytes of data. QR Code symbols can also be used to encode GS1 data. QR Code symbols can by default encode either characters in the Latin-1 set or Kanji, Katakana and ASCII characters which are members of the Shift JIS encoding scheme. In addition QR Code supports other character sets using the ECI mechanism. Input should usually be entered as UTF-8 with conversion to Latin-1 or Shift JIS being carried out by Zint. A separate symbology ID (BARCODE_HIBC_QR) can be used to encode Health Industry Barcode (HIBC) data.

Non-ASCII data density may be maximized by using the --fullmultibyte switch (API option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports this before using.

QR Code has eight different masks designed to minimize unwanted patterns. The best mask to use is selected automatically by Zint but may be manually specified by using the --mask switch with values 0-7, or in the API by setting option_3 = (N + 1) << 8 where N is 0-7. To use with ZINT_FULL_MULTIBYTE set

option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8

The --fast option (API input_mode |= FAST_MODE) may be used when leaving Zint to automatically select a mask to reduce the number of masks to try to four (0, 2, 4, 7).

QR Code supports Structured Append of up to 16 symbols and a numeric ID (parity), which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The parity ID ranges from 0 (default) to 255, and for full compliance should be set to the value obtained by XOR-ing together each byte of the complete data forming the sequence. Currently this calculation must be done outside of Zint.

6.6.4 Micro QR Code (ISO 18004)

A miniature version of the QR Code symbol for short messages, Micro QR Code symbols can encode either Latin-1 characters or Shift JIS characters. Input should be entered as a UTF-8 stream with conversion to Latin-1 or Shift JIS being carried out automatically by Zint.

zint -b MICROQR -d "01234567"
Figure 114: zint -b MICROQR -d "01234567"

A preferred symbol size can be selected by using the --vers option (API option_2), as shown in the table below. Note that versions M1 and M2 have restrictions on what characters can be encoded.

Table 33: Micro QR Code Sizes
InputVersionSymbol SizeAllowed Characters
1M111 x 11Numeric only
2M213 x 13Numeric, uppercase letters, space, and the characters "$%*+-./:"
3M315 x 15Latin-1 and Shift JIS
4M417 x 17Latin-1 and Shift JIS

Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or 9 Kanji characters.

Except for version M1, which is always ECC level L, the amount of ECC codewords can be adjusted using the --secure option (API option_1); however ECC level H is not available for any version, and ECC level Q is only available for version M4:

Table 34: Micro QR ECC Levels
InputECC LevelError Correction CapacityRecovery CapacityAvailable for Versions
1LApprox 20% of symbolApprox 7%M1, M2, M3, M4
2MApprox 37% of symbolApprox 15%M2, M3, M4
3QApprox 55% of symbolApprox 25%M4

The defaults for symbol size and ECC level depend on the input and whether either of them is specified.

For barcode readers that support it, non-ASCII data density may be maximized by using the --fullmultibyte switch (API option_3 = ZINT_FULL_MULTIBYTE).

Micro QR Code has four different masks designed to minimize unwanted patterns. The best mask to use is selected automatically by Zint but may be manually specified by using the --mask switch with values 0-3, or in the API by setting option_3 = (N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set

option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8

6.6.5 Rectangular Micro QR Code (rMQR) (ISO 23941)

A rectangular version of QR Code, rMQR supports encoding of GS1 data, and either Latin-1 characters or Shift JIS characters, and other encodings using the ECI mechanism. As with other symbologies data should be entered as UTF-8 with conversion being handled by Zint.

zint -b RMQR -d "0123456"
Figure 115: zint -b RMQR -d "0123456"

The amount of ECC codewords can be adjusted using the --secure option (API option_1), however only ECC levels M and H are valid for this type of symbol.

Table 35: rMQR ECC Levels
InputECC LevelError Correction CapacityRecovery Capacity
2MApprox 37% of symbolApprox 15%
4HApprox 65% of symbolApprox 30%

The preferred symbol sizes can be selected using the --vers option (API option_2) as shown in the table below. Input values between 33 and 38 fix the height of the symbol while allowing Zint to determine the minimum symbol width.

Table 36: rMQR Sizes
InputVersionSymbol Size (HxW)InputVersionSymbol Size (HxW)
1R7x437 x 4320R13x7713 x 77
2R7x597 x 5921R13x9913 x 99
3R7x777 x 7722R13x13913 x 139
4R7x997 x 9923R15x4315 x 43
5R7x1397 x 13924R15x5915 x 59
6R9x439 x 4325R15x7715 x 77
7R9x599 x 5926R15x9915 x 99
8R9x779 x 7727R15x13915 x 139
9R9x999 x 9928R17x4317 x 43
10R9x1399 x 13929R17x5917 x 59
11R11x2711 x 2730R17x7717 x 77
12R11x4311 x 4331R17x9917 x 99
13R11x5911 x 5932R17x13917 x 139
14R11x7711 x 7733R7xW7 x automatic width
15R11x9911 x 9934R9xW9 x automatic width
16R11x13911 x 13935R11xW11 x automatic width
17R13x2713 x 2736R13xW13 x automatic width
18R13x4313 x 4337R15xW15 x automatic width
19R13x5913 x 5938R17xW17 x automatic width

The largest version R17x139 (32) can encode up to 361 digits, 219 alphanumerics, 150 bytes, or 92 Kanji characters.

For barcode readers that support it, non-ASCII data density may be maximized by using the --fullmultibyte switch or in the API by setting option_3 = ZINT_FULL_MULTIBYTE.

6.6.6 UPNQR (Univerzalnega Plačilnega Naloga QR)

A variation of QR Code used by Združenje Bank Slovenije (Bank Association of Slovenia). The size, error correction level and ECI are set by Zint and do not need to be specified.

zint -b UPNQR -i upn_utf8.txt --quietzones
Figure 116: zint -b UPNQR -i upn_utf8.txt --quietzones

UPNQR is unusual in that it uses Latin-2 (ISO/IEC 8859-2 plus ASCII) formatted data. Zint will accept UTF-8 data and convert it to Latin-2, or if your data is already Latin-2 formatted use the --binary switch (API input_mode = DATA_MODE).

The following example creates a symbol from data saved as a Latin-2 file:

zint -o upnqr.png -b UPNQR --scale=3 --binary -i upn.txt

A mask may be manually specified and the --fast option used as with 6.6.3 QR Code (ISO 18004).

6.6.7 MaxiCode (ISO 16023)

Developed by UPS the MaxiCode symbology employs a grid of hexagons surrounding a bullseye finder pattern. This symbology is designed for the identification of parcels.

zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96
Figure 117: zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96

MaxiCode symbols can be encoded in one of five modes. In modes 2 and 3 MaxiCode symbols are composed of two parts named the primary and secondary messages. The primary message consists of a Structured Carrier Message which includes various data about the package being sent and the secondary message usually consists of address data in a data structure. The format of the primary message required by Zint is given in the following table.

Table 37: MaxiCode Structured Carrier Message Format
CharactersMeaning
1 - 9Postcode data which can consist of up to 9 digits (for mode 2) or up to 6 alphanumeric characters (for mode 3). Remaining unused characters for mode 3 can be filled with the SPACE character (ASCII 32) or omitted. (adjust the following character positions according to postcode length)
10 - 12Three-digit country code according to ISO 3166-1.
13 - 15Three-digit service code. This depends on your parcel courier.

The primary message can be set at the command prompt using the --primary switch (API primary). The secondary message uses the normal data entry method. For example:

zint -o test.eps -b MAXICODE --primary="999999999840012" \
    -d "Secondary Message Here"

When using the API the primary message must be placed in the primary string. The secondary is entered in the same way as described in 5.2 Encoding and Saving to File. When either of these modes is selected Zint will analyse the primary message and select either mode 2 or mode 3 as appropriate.

As a convenience the secondary message for modes 2 and 3 can be set to be prefixed by the ISO/IEC 15434 Format "01" (transportation) sequence "[)>\R01\Gvv", where vv is a 2-digit version, by using the --scmvv switch (API option_2 = vv + 1). For example to use the common version "96" (ASC MH10/SC 8):

zint -b MAXICODE --primary="152382802840001" --scmvv=96 --esc -d \
  "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E"

will prefix "[)>\R01\G96" to the secondary message. (\R, \G and \E are the escape sequences for Record Separator, Group Separator and End of Transmission respectively - see Table 2: Escape Sequences.)

Modes 4 to 6 can be accessed using the --mode switch (API option_1). Modes 4 to 6 do not have a primary message. For example:

zint -o test.eps -b MAXICODE --mode=4 -d "A MaxiCode Message in Mode 4"

Mode 6 is reserved for the maintenance of scanner hardware and should not be used to encode user data.

This symbology uses Latin-1 character encoding by default but also supports the ECI encoding mechanism. The maximum length of text which can be placed in a MaxiCode symbol depends on the type of characters used in the text.

Example maximum data lengths are given in the table below:

Table 38: MaxiCode Data Length Maxima
ModeMaximum Data Length for Capital LettersMaximum Data Length for Numeric DigitsNumber of Error Correction Codewords
2*8412650
3*8412650
49313850
57711366
69313850

* - secondary only

MaxiCode supports Structured Append of up to 8 symbols, which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). It does not support specifying an ID.

MaxiCode uses a different scaling than other symbols for raster output, see 4.9.3 MaxiCode Raster Scaling, and also for EMF vector output, when the scale is multiplied by 20 instead of 2.

6.6.8 Aztec Code (ISO 24778)

Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code symbol is a matrix symbol with a distinctive square bullseye finder pattern.

zint -b AZTEC -d "123456789012"
Figure 118: zint -b AZTEC -d "123456789012"

Zint can generate Compact Aztec Code (sometimes called Small Aztec Code) as well as ‘full-range’ Aztec Code symbols and by default will automatically select symbol type and size dependent on the length of the data to be encoded. Error correction codewords will normally be generated to fill at least 23% of the symbol. Two options, mutually exclusive, are available to change this behaviour:

  1. The size of the symbol can be specified using the --vers option (API option_2) to a value between 1 and 36 according to the following table. The symbols marked with an asterisk (*) in the table below are ‘compact’ symbols, meaning they have a smaller bullseye pattern at the centre of the symbol.
Table 39: Aztec Code Sizes
InputSymbol SizeInputSymbol SizeInputSymbol Size
115 x 15*1353 x 5325105 x 105
219 x 19*1457 x 5726109 x 109
323 x 23*1561 x 6127113 x 113
427 x 27*1667 x 6728117 x 117
519 x 191771 x 7129121 x 121
623 x 231875 x 7530125 x 125
727 x 271979 x 7931131 x 131
831 x 312083 x 8332135 x 135
937 x 372187 x 8733139 x 139
1041 x 412291 x 9134143 x 143
1145 x 452395 x 9535147 x 147
1249 x 4924101 x 10136151 x 151

Note that in symbols which have a specified size the amount of error correction is dependent on the length of the data input and Zint will allow error correction capacities as low as 3 codewords (the absolute minimum, not recommended, and anything less than 5% + 3 codewords will result in a warning).

  1. Alternatively the amount of error correction data can be specified by setting the --secure option (API option_1) to a value from the following table.
Table 40: Aztec Code Error Correction Modes
ModeError Correction Capacity
1>=10% + 3 codewords
2>=23% + 3 codewords
3>=36% + 3 codewords
4>=50% + 3 codewords

It is not possible to select both symbol size and error correction capacity for the same symbol. If both options are selected then the error correction capacity selection will be ignored.

Compact symbols can be excluded from consideration on automatic sizing by specifying --azfull (API symbol->option_3 = ZINT_AZTEC_FULL).

Aztec Code supports ECI encoding and can encode up to a maximum length of approximately 3823 numeric or 3067 alphabetic characters or 1914 bytes of data. A separate symbology ID (BARCODE_HIBC_AZTEC) can be used to encode Health Industry Barcode (HIBC) data.

For a faster but less optimal encodation, the --fast option (API input_mode |= FAST_MODE) may be used.

Aztec Code supports Structured Append of up to 26 symbols and an optional alphanumeric ID of up to 32 characters, which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The ID cannot contain spaces. If an ID is not given, no ID is encoded.

6.6.9 Aztec Runes (ISO 24778)

A truncated version of compact Aztec Code for encoding whole integers between 0 and 255, as defined in ISO/IEC 24778 Annex A. Includes Reed-Solomon error correction. It does not support Structured Append.

zint -b AZRUNE -d "125"
Figure 119: zint -b AZRUNE -d "125"

6.6.10 Code One

A matrix symbology developed by Ted Williams in 1992 which encodes data in a way similar to Data Matrix, Code One is able to encode the Latin-1 character set or GS1 data, and also supports the ECI mechanism.

zint -b CODEONE -d "1234567890123456789012"
Figure 120: zint -b CODEONE -d "1234567890123456789012"

There are two types of Code One symbol - fixed-ratio symbols which are roughly square (versions A through to H) and variable-width versions (versions S and T). These can be selected by using --vers (API option_2) as shown in the table below:

Table 41: Code One Sizes
InputVersionSize (H x W)Numeric Data CapacityAlphanumeric Data Capacity
1A16 x 182213
2B22 x 224427
3C28 x 3210464
4D40 x 42217135
5E52 x 54435271
6F70 x 76886553
7G104 x 9817551096
8H148 x 13435502218
9S8 x automatic width18N/A
10T16 x automatic width9055

Version S symbols can only encode numeric data. The width of version S and version T symbols is determined by the length of the input data.

Code One supports Structured Append of up to 128 symbols, which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). It does not support specifying an ID. Structured Append is not supported with GS1 data nor for Version S symbols.

6.6.11 Grid Matrix

Grid Matrix groups modules in a chequerboard pattern, and by default supports the GB 2312 standard set, which includes Hanzi, ASCII and a small number of ISO/IEC 8859-1 characters. Input should be entered as UTF-8 with conversion to GB 2312 being carried out automatically by Zint. Up to around 1529 alphanumeric characters or 2751 digits may be encoded. The symbology also supports the ECI mechanism. Support for GS1 data has not yet been implemented.

zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器  200mA至2A tel:86 019 82512738"
Figure 121: zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738"

The size of the symbol and the error correction capacity can be specified. If you specify both of these values then Zint will make a ‘best-fit’ attempt to satisfy both conditions. The symbol size can be specified using the --vers option (API option_2), and the error correction capacity can be specified by using the --secure option (API option_1), according to the following tables.

Table 42: Grid Matrix Sizes
InputSymbol SizeInputSymbol Size
118 x 188102 x 102
230 x 309114 x 114
342 x 4210126 x 126
454 x 5411138 x 138
566 x 6612150 x 150
678 x 7813162 x 162
790 x 90
Table 43: Grid Matrix Error Correction Modes
ModeError Correction Capacity
1Approximately 10%
2Approximately 20%
3Approximately 30%
4Approximately 40%
5Approximately 50%

Non-ASCII data density may be maximized by using the --fullmultibyte switch (API option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports this before using.

Grid Matrix supports Structured Append of up to 16 symbols and a numeric ID (file signature), which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The ID ranges from 0 (default) to 255.

6.6.12 DotCode

DotCode uses a grid of dots in a rectangular formation to encode characters up to a maximum of approximately 1220 characters (or 2940 numeric digits). The symbology supports ECI encoding and GS1 data encoding. By default Zint will produce a symbol which is approximately square, however the width of the symbol can be adjusted by using the --cols option (API option_2) (maximum 200). Outputting DotCode to raster images (BMP, GIF, PCX, PNG, TIF) will require setting the scale of the image to a larger value than the default (e.g. approximately 10) for the dots to be plotted correctly. Approximately 33% of the resulting symbol is comprised of error correction codewords.

zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1
Figure 122: zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1

DotCode has two sets of 4 masks, designated 0-3 and 0’-3’, the second "prime" set being the same as the first with corners lit. The best mask to use is selected automatically by Zint but may be manually specified by using the --mask switch with values 0-7, where 4-7 denote 0’-3’, or in the API by setting option_3 = (N + 1) << 8 where N is 0-7.

DotCode supports Structured Append of up to 35 symbols, which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). It does not support specifying an ID.

6.6.13 Han Xin Code (ISO 20830)

Also known as Chinese Sensible Code, Han Xin is capable of encoding characters in either the Latin-1 character set or the GB 18030 character set (which is a UTF, i.e. includes all Unicode characters, optimized for Chinese characters) and is also able to support the ECI mechanism. Support for the encoding of GS1 data has not yet been implemented.

zint -b HANXIN -d "Hanxin Code symbol"
Figure 123: zint -b HANXIN -d "Hanxin Code symbol"

The size of the symbol can be specified using the --vers option (API option_2) to a value between 1 and 84 according to the following table.

Table 44: Han Xin Sizes
InputSymbol SizeInputSymbol SizeInputSymbol Size
123 x 232979 x 7957135 x 135
225 x 253081 x 8158137 x 137
327 x 273183 x 8359139 x 139
429 x 293285 x 8560141 x 141
531 x 313387 x 8761143 x 143
633 x 333489 x 8962145 x 145
735 x 353591 x 9163147 x 147
837 x 373693 x 9364149 x 149
939 x 393795 x 9565151 x 151
1041 x 413897 x 9766153 x 153
1143 x 433999 x 9967155 x 155
1245 x 4540101 x 10168157 x 157
1347 x 4741103 x 10369159 x 159
1449 x 4942105 x 10570161 x 161
1551 x 5143107 x 10771163 x 163
1653 x 5344109 x 10972165 x 165
1755 x 5545111 x 11173167 x 167
1857 x 5746113 x 11374169 x 169
1959 x 5947115 x 11575171 x 171
2061 x 6148117 x 11776173 x 173
2163 x 6349119 x 11977175 x 175
2265 x 6550121 x 12178177 x 177
2367 x 6751123 x 12379179 x 179
2469 x 6952125 x 12580181 x 181
2571 x 7153127 x 12781183 x 183
2673 x 7354129 x 12982185 x 185
2775 x 7555131 x 13183187 x 187
2877 x 7756133 x 13384189 x 189

The largest version (84) can encode 7827 digits, 4350 ASCII characters, up to 2175 Chinese characters, or 3261 bytes, making it the most capacious of all the barcodes supported by Zint.

There are four levels of error correction capacity available for Han Xin Code which can be set by using the --secure option (API option_1) to a value from the following table.

Table 45: Han Xin Error Correction Modes
ModeRecovery Capacity
1Approx 8%
2Approx 15%
3Approx 23%
4Approx 30%

Non-ASCII data density may be maximized by using the --fullmultibyte switch (API option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports this before using.

Han Xin has four different masks designed to minimize unwanted patterns. The best mask to use is selected automatically by Zint but may be manually specified by using the --mask switch with values 0-3, or in the API by setting option_3 = (N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set

option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8

6.6.14 Ultracode

This symbology uses a grid of coloured elements to encode data. ECI and GS1 modes are supported.

zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"
Figure 124: zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"

The amount of error correction can be set using the --secure option (API option_1) to a value as shown in the following table.

Table 46: Ultracode Error Correction Values
ValueEC LevelAmount of symbol holding error correction data
1EC00% - Error detection only
2EC1Approx 5%
3EC2Approx 9% - Default value
4EC3Approx 17%
5EC4Approx 25%
6EC5Approx 33%

Zint does not currently implement data compression by default, but this can be initiated through the API by setting

symbol->option_3 = ULTRA_COMPRESSION;

With compression, up to 504 digits, 375 alphanumerics or 252 bytes can be encoded.

Revision 2 of Ultracode (2023) may be specified using --vers=2 (API option_2 = 2).


WARNING: Revision 2 of Ultracode was finalized December 2023 and Zint has not yet been updated to support it. Do not use.


Ultracode supports Structured Append of up to 8 symbols and an optional numeric ID (File Number), which can be set by using the --structapp option (see 4.17 Structured Append) (API structapp). The ID ranges from 1 to 80088. If an ID is not given, no ID is encoded.

6.7 Other Barcode-Like Markings

6.7.1 Facing Identification Mark (FIM)

Used by the United States Postal Service (USPS), the FIM symbology is used to assist automated mail processing.

zint -b FIM --compliantheight -d "C"
Figure 125: zint -b FIM --compliantheight -d "C"

There are only 5 valid symbols which can be generated using the characters A-E as shown in the table below.

Table 47: Valid FIM Characters
Code LetterUsage
AUsed for courtesy reply mail and metered reply mail with a
pre-printed POSTNET symbol.
BUsed for business reply mail without a pre-printed zip code.
CUsed for business reply mail with a pre-printed zip code.
DUsed for Information Based Indicia (IBI) postage.
EUsed for customized mail with a USPS Intelligent Mail barcode.

6.7.2 Flattermarken

Used for the recognition of page sequences in print-shops, the Flattermarken is not a true barcode symbol and requires precise knowledge of the position of the mark on the page. The Flattermarken system can encode numeric data up to a maximum of 128 digits and does not include a check digit.

zint -b FLAT -d "1304056"
Figure 126: zint -b FLAT -d "1304056"