Two-Dimensional symbols

Click here for a condensed list of two-dimensional symbologies.

Data Matrix ECC200 (ISO 16022)

Data Matrix ECC200

Also known as Semacode, this symbology was developed in 1989 by Acuity CiMatrix in partnership with the US DoD and NASA. The symbol can encode a large amount of data in a small area. characters in the Latin-1 set by default but also supports encoding GS1 data or other character sets using the ECI mechanism.

Note

A separate symbology ID 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.

Note

Only ECC200 encodingopen in new window is supported.

Data Matrix Options

The resolution of the Data Matrix can be adjusted to one of the following two options, via the DataMatrix enumerated type.

  • DM_DMRE - Resolution automatically determined (default).
  • DM_SQUARE - Square Data Matrix.

Example

createStream({
  symbology: SymbologyType.DATAMATRIX,
  option3: DataMatrix.DM_SQUARE
}, '12345')

Data Matrix Size

The size of the generated symbol can also be adjusted using the by setting option2 to one of the following input values:

InputSymbol SizeInputSymbol Size
110 x 101664 x 64
212 x 121772 x 72
314 x 141880 x 80
416 x 161988 x 88
518 x 182096 x 96
620 x 2021104 x 104
722 x 2222120 x 120
824 x 2423132 x 132
926 x 2624144 x 144
1032 x 32258 x 18
1136 x 36268 x 32
1240 x 402712 x 26
1344 x 442812 x 36
1448 x 482916 x 36
1552 x 523016 x 48

Tip

To force the symbol to be rendered as a square (versions 1-24), set option3 to DM_SQUARE Data Matrix option.

Data Matrix Rectangular Extension (DMRE)

DMRE may be generated by setting option2 to one of the following values:

InputSymbol SizeInputSymbol Size
318 x 483524 x 48
328 x 643624 x 64
3312 x 643726 x 48
3416 x 643826 x 64

Tip

DMRE symbol sizes may be activated in automatic mode by setting option3 to the DM_SQUARE Data Matrix option.

QR Code (ISO 18004)

QR Code

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

Error correction

Four levels of error correction are available by setting option1 to one of the following input values:

InputECC LevelError Correction CapacityRecovery Capacity
1L (default)Approx 20% of symbolApprox 7%
2MApprox 37% of symbolApprox 15%
3QApprox 55% of symbolApprox 25%
4HApprox 65% of symbolApprox 30%

Example

The following example creates a QR code:

createStream({
  symbology: SymbologyType.QRCODE,
  option2: 1
}, '12345')

QR Code Size

The size of the symbol can be set to the QR Code version required (1-40). The size of symbol generated can be set by passing option2 to one of the following input values:

InputSymbol SizeInputSymbol Size
121 x 2121101 x 101
225 x 2522105 x 105
329 x 2923109 x 109
433 x 3324113 x 113
537 x 3725117 x 117
641 x 4126121 x 121
745 x 4527125 x 125
849 x 4928129 x 129
953 x 5329133 x 133
1057 x 5730137 x 137
1161 x 6131141 x 141
1265 x 6532145 x 145
1369 x 6933149 x 149
1473 x 7334153 x 153
1577 x 7735157 x 157
1681 x 8136161 x 161
1785 x 8537165 x 165
1889 x 8938169 x 169
1993 x 9339173 x 173
2097 x 9740177 x 177

Important

The maximum capacity of a (version 40) QR Code symbol is 7089 numeric digits (4296 alphanumeric characters, or 2953 bytes of data).

Encoding GS1 data

QR Code symbols can also be used to encode GS1 data. QR Code symbols can by default encode characters in the Latin-1 set and Kanji characters which are members of the Shift-JIS encoding scheme. QR Code also supports using other character sets using the ECI mechanism.

Note

A separate symbology ID 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.

Micro QR Code (ISO 18004)

Micro QR Code

A miniature version QR Code for short messages.

Error correction levels can be set the same way as for QR Code by setting option1.

Mini QR Code Size

A preferred symbol size can be selected by using the option2 value to one of the following inputs:

InputVersionSymbol Size
1M111 x 11
2M213 x 13
3M315 x 15
4M417 x 17

Important

The actual version used may be different if required by the input data.

Rectangular Micro QR Code (rMQR)

Rectangular Micro QR Code (rMQR)

A rectangular version of QR Code. Like QR code rMQR supports encoding of GS-1 data, Latin-1 and Kanji characters in the Shift-JIS encoding schemeopen in new window. It does not support other ISO/IEC 8859open in new window character sets or Unicode. As with other symbologies, data should be entered as UTF-8 with the conversion to Shift-JIS being handled by the library itself.

rMQR Codewords

The amount of ECC codewords can be adjusted the same way as for QR Code by setting option1. Note that only ECC levels M and H are valid for this type of symbol.

InputECC LevelError Correction CapacityRecovery Capacity
2MApprox 37% of symbolApprox 15%
4HApprox 65% of symbolApprox 30%

rMQR Size

The size of the symbol can be set by setting option2 to the QR Code version required (1-40). The size of symbol generated is shown in the table below.

InputVersionSymbol Size
1R7 x 437 x 43
2R7 x 597 x 59
3R7 x 777 x 77
4R7 x 997 x 99
5R7 x 1397 x 139
6R9 x 439 x 43
7R9 x 599 x 59
8R9 x 779 x 77
9R9 x 999 x 99
10R9 x 1399 x 139
11R11 x 2711 x 27
12R11 x 4311 x 43
13R11 x 5911 x 59
14R11 x 7711 x 77
15R11 x 9911 x 99
16R11 x 13911 x 139
17R13 x 2713 x 27
18R13 x 4313 x 43
19R13 x 5913 x 59
20R13 x 7713 x 77
21R13 x 9913 x 99
22R13 x 13913 x 139
23R17 x 4315 x 43
24R15 x 5915 x 59
25R15 x 7715 x 77
26R15 x 9915 x 99
27R15 x 13915 x 139
28R17 x 4317 x 43
29R17 x 5917 x 59
30R17 x 7717 x 77
31R17 x 9917 x 99
32R17 x 13917 x 139
33Fixed height 7
34Fixed height 9
35Fixed height 11
36Fixed height 13
37Fixed height 15
38Fixed height 17

Maximizing Non-ASCII Data Density

TIP

Non-ASCII data density may be maximized by by setting option3 to 200 for barcode readers that support it.

UPNQR - Univerzalni Plačilni Nalog QR

barcode

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

UPNQR Encoding

UPNQR is unusual in that it uses ISO-8859-2open in new window-encoded data. Any UTF-8 data will be automatically converted to ISO-8859-2 format.

Note

If your data is already formatted as ISO-8859-2, set the encoding flag to EncodingMode.DATA_MODE.

Example

The following example creates a symbol from data saved in an ISO-8859-2 file:

createStream({
  symbology: SymbologyType.UPNQR,
  option1: 2,
  borderWidth: 5,
  scale: 3,
  encoding: EncodingMode.DATA_MODE
}, 'to je testna črtna koda')

Maxicode (ISO 16023)

Maxicode

Developed by UPS the Maxicode symbology employs a grid of hexagons surrounding a 'bulls-eye' finder pattern. This symbology is designed for the identification of parcels.

Maxicode symbols can be encoded in one of five modes (via option1) as explained below.

Modes 2 and 3

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 data field 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 is given in the following table:

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 should be filled with the SPACE character (ASCII 32).
10-12Three digit country code according to ISO 3166open in new window.
13-15Three digit service code. This depends on your parcel courier.

The primary message can be set via the primary option. The secondary message uses the normal data entry method.

Example

createStream({
  symbology: SymbologyType.MAXICODE,
  option1: 2,
  primary: '999999999840012'
}, 'Secondary Message Here')

Important

The primary message must be set as the primary value.

Note

When no mode is selected, the appropriate mode will be automatically selected based on the content of the primary message.

Modes 4, 5, and 6

Modes 4, 5, and 6 do not require a primary message.

Example

createStream({
  symbology: SymbologyType.MAXICODE,
  option1: 4
}, 'A MaxiCode Message in Mode 4')

Note

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

Maximum Data Lengths

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:

ModeMaximum Data Length for Capital LettersMaximum Data Length for Numeric DigitsNumber of Error Correction Codewords
2 (secondary only)8412650
3 (secondary only)8412650
49313550
57711066
69313550

Aztec Code (ISO 24778)

Aztec Code

Invented by Andrew Longacre at Welch Allyn Inc in 1995, the Aztec Code symbol is a matrix symbol with a distinctive bulls-eye finder pattern.

Important

Depending on the length of the input data, a Compact Aztec Code (sometimes called Small Aztec Code) or a "full-range" Aztec Code may be selected.

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.

Note

A separate symbology ID 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.

Error correction

Error correction codewords will normally be generated to fill at least 23% of the symbol. Symbols which have a specified size the amount of error correction is dependent on the length of the data input. Error correction capacities as low as 3 codewords are acceptable.

There are two ways to change this behavior:

Error correction capacity

The amount of error correction data can be specified by setting option1 to one of the following modes:

ModeError Correction Capacity
1>10% + 3 codewords
2>23% + 3 codewords
3>36% + 3 codewords
4>50% + 3 codewords

Symbol Size

To specify the desired size of the symbol, set option2 to one of the following input values:

InputSymbol SizeInputSymbol Size
115 x 15*1979 x 79
219 x 19*2083 x 83
323 x 23*2187 x 87
427 x 27*2291 x 91
519 x 192395 x 95
623 x 2324101 x 101
727 x 2725105 x 105
831 x 3126109 x 109
937 x 3727113 x 113
1041 x 4128117 x 117
1145 x 4529121 x 121
1249 x 4930125 x 125
1353 x 5331131 x 131
1457 x 5732135 x 135
1561 x 6133139 x 139
1667 x 6734143 x 143
1771 x 7135147 x 147
1875 x 7536151 x 151

Example

The following will render a 45x45 Aztec Code symbol with 23% error correction capacity:

createStream({
  symbology: SymbologyType.AZTEC,
  option1: 2,
  option2: 11
}, '12345')

Note

The symbols marked with an asterisk (*) in the table below are "compact" symbols, meaning they have a smaller bulls-eye pattern at the centre of the symbol.

Important

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.

Aztec Runes

Aztec Runes

Defined in ISO/IEC 24778 (Annex A)open in new window, a truncated version of compact Aztec Code for encoding whole integers between 0 and 255. Includes Reed-Solomon error correctionopen in new window.

Example

The following will render an Aztec Runes symbol encoding 123:

createStream({
  symbology: SymbologyType.AZRUNE
}, '123')

Code One

Code One

A matrix symbology which encodes data in a way similar to Data Matrix ECC200. Code One is able to encode the Latin-1 character set or GS1 data.

There are two types of Code One symbols:

  • Variable height symbols, which are roughly square (versions A thought to H).
  • Fixed-height versions (version S and T).

The type can be specified by setting option2 to one of the following input values:

InputVersionSizeNumeric 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
9S8X height18N/A
10T16X height9055

Example

The following will render a 22x22 Code One symbol encoding An Example:

createStream({
  symbology: SymbologyType.CODEONE,
  option2: 2
}, 'An Example')

Important

  • Version S symbols can only encode numeric data.
  • The widths of version S and version T symbols are determined by the lengths of their input data.

Grid Matrix

Grid Matrix

Encoding

By default Grid Matrix supports encoding in Latin-1 and Chinese characters within the GB 2312 standard setopen in new window to be encoded in a checkerboard pattern. Input should be entered as a Unicode UTF-8 stream with conversion to GB 2312 being carried out automatically. The symbology also supports the ECI mechanism.

Error Correction and Size

There are two ways to set the error correction level:

Error correction capacity

The error correction capacity can be specified by setting the option1 value to one of the following inputs:

ModeError Correction Capacity
1Approximately 10%
2Approximately 20%
3Approximately 30%
4Approximately 40%
5Approximately 50%

Symbol Size

The symbol size can be specified by setting the option2 value to one of the following inputs:

InputSize
118 x 18
230 x 30
342 x 42
454 x 54
566 x 66
678 x 78
790x 90
8102 x 102
9114 x 114
10126 x 126
11138 x 138
12150 x 150
13162 x 162

Example

The following will render a 30x30 Grid Matrix symbol with 20% error correction encoding 12345:

createStream({
  symbology: SymbologyType.GRIDMATRIX,
  option1: 2,
  option2: 2
}, '12345')

Important

If you specify both of these values, this library will make a 'best-fit' attempt to satisfy both conditions.

DotCode

barcode

DotCode uses a grid of dots in a rectangular formation to encode characters up to a maximum of approximately 450 characters (or 900 numeric digits). The symbology supports ECI encoding and GS-1 data EncodingMode.

Width

By default, the library will produce a symbol which is approximately square. However, the width of the symbol can be adjusted by setting option2 to the desired width (in pixels).

Example

The following will render a DotCode symbol encoding 12345:

createStream({
  symbology: SymbologyType.DOTCODE
}, '12345')

Important

Outputting DotCode to PNG will require setting the scale of the image to a larger value than the default (~10 pixels) for the dots to be plotted correctly.

Note

Approximately 33% of the resulting symbol is comprised of error correction codewords.

Han Xin Code

barcode

Also known as Chinese Sensible Code, this symbology is capable of encoding characters in the GB-18030 character setopen in new window and is also able to support the ECI mechanism.

Important

Han Xin does not support the encoding of GS-1 data.

Error Correction and Size

There are two ways to set the error correction level:

Error correction capacity

There are four levels of error correction capacity available for Han Xin Code. To specify one, set option1 to one of the following modes:

ModeRecovery Capacity
1Approx 8%
2Approx 15%
3Approx 23%
4Approx 30%

Symbol Size

The size of the symbol can be specified by setting option2 to one of the following input values:

InputSymbol SizeInputSymbol Size
123 x 2343107 x 107
225 x 2544109 x 109
327 x 2745111 x 111
429 x 2946113 x 113
531 x 3147115 x 115
633 x 3348117 x 117
735 x 3549119 x 119
837 x 3750121 x 121
939 x 3951123 x 123
1041 x 4152125 x 125
1143 x 4353127 x 127
1245 x 4554129 x 129
1347 x 4755131 x 131
1449 x 4956133 x 133
1551 x 5157135 x 135
1653 x 5358137 x 137
1755 x 5559139 x 139
1857 x 5760141 x 141
1959 x 5961143 x 143
2061 x 6162145 x 145
2163 x 6363147 x 147
2265 x 6564149 x 149
2367 x 6765151 x 151
2469 x 6966153 x 153
2571 x 7167155 x 155
2673 x 7368157 x 157
2775 x 7569159 x 159
2877 x 7770161 x 161
2979 x 7971163 x 163
3081 x 8172165 x 165
3183 x 8373167 x 167
3285 x 8574169 x 169
3387 x 8775171 x 171
3489 x 8976173 x 173
3591 x 9177175 x 175
3693 x 9378177 x 177
3795 x 9579179 x 179
3897 x 9780181 x 181
3999 x 9981183 x 183
40101 x 10182185 x 185
41103 x 10383187 x 187
42105 x 10584189 x 189

Example

The following will render a 33x33 Han Xin symbol encoding 12345 with ~23% error correction:

createStream({
  symbology: SymbologyType.HANXIN,
  option1: 3,
  option2: 6
}, '12345')

Important

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.

Ultracode

Ultracode

Ultracode uses a grid of coloured elements to encode data. ECI and GS-1 modes are supported.

Note

Compression is not implemented by default, but can be initiated by setting option3 to 128.

Error correction capacity

The amount of error correction can be set by setting option1 to one of the following values:

ValueLevelAmount of symbol-holding error correction data
1EC00% - Error detection
2EC1Approx 5%
3EC2Approx 9% (default)
4EC3Approx 17%
5EC4Approx 25%
6EC5Approx 33%

Warning

Ultracode is a symbology which is still under development by Zint. It is strongly advised against its use in production.