Maxicode symbology

About Maxicode

MaxiCode is a fixed-size (approximately 1 inch by 1 inch) 2D matrix barcode symbology which is made up of offset rows of hexagonal modules arranged around a unique finder pattern. MaxiCode was originally created and used by United Parcel Service (UPS) for tracking and managing the shipment of packages.

MaxiCode barcode can encode 256 international characters; values 0-127, in accordance with ANSI X3.4, i.e. all 128 ASCII characters and values 128-255 in accordance with ISO 8859-1 (Latin Alphabet No. 1). Although the capacity of a MaxiCode symbol is not as high as other 2D matrix barcode symbologies, it was primarily designed to encode address data. The maximum data capacity in a single MaxiCode Symbol is 93 alphanumeric characters or 138 numeric characters.

MaxiCode features "Structured Append" which allows files of data to be represented in up to 8 MaxiCode symbols. The original data can be correctly reconstructed regardless of the order in which the symbols are scanned.

MaxiCode symbols are divided into a primary and a secondary message featuring Reed-Solomon error correction. In general, the Primary message normally encodes a postal code, a 3 digit country code and a 3 digit class of service number while the Secondary message normally encodes address data and any other required information. In addition, MaxiCode has modes which are used to define the structuring of the data and error correction within a symbol. The following modes are available:

MaxiCode Modes Description
Mode 0 It is obsolete and superseded by Modes 2 and 3.
Mode 1 It is obsolete and superseded by Mode 4.
Mode 2 & 3 Structured Carrier Message. Modes 2 and 3 are designed for use in the transport industry. They encode the destination address and the class of service as defined by the carrier.
Mode 4 Standard Symbol. It indicates that the symbol employs Enhanced Error Correction (EEC) in the Primary Message and Standard Error Correction (SEC) for the Secondary Message.
Mode 5 Full EEC. It indicates that the symbol employs Enhanced Error Correction (EEC) for both the Primary and Secondary Message.
Mode 6 Reader Programming. It indicates that the symbol encodes a message used to program the reader system and that Standard Error Correction (SEC) is used for the Secondary Message. When a Mode 6 symbol is read no data shall be transmitted.

 

Mode

MaxiCode has modes which are used to define the format of the message and the level of error correction within a symbol:

  • Mode 2: It encodes a structured carrier message with a numeric postal code, and an optional secondary message. A numeric postal code, a country code, and a class of service code assigned by the carrier are included in the structured carrier message.

    The symbol employs enhanced error correction for the structured carrier message and standard error correction for the secondary message, see also the "Error checking and correcting (ECC)" section below.

    It is designed for use in the transport industry. Primary use is US domestic destinations.

    The formats of mode 2 barcode text are specified in the following list:

    • [)>{RS}01{GS}YYPPPPPPPPP{GS}CCC{GS}SSS{GS}MESSAGE{RS}{EOT}

      • YY: Date (year), 2 digits.
      • PPPPPPPPP: Numeric postal code, up to 9 digits. Only first 9 digits will be encoded if its length is greater than 9 digits.
      • CCC: Country code, 3 digits.
      • SSS: Serivce class, 3 digits
      • MESSAGE: Optional secondary message. All 256 of the ASCII characters can be used. A maximum of about 71 alphanumeric characters or about 107 digits can be encoded in the message.
      • {RS}: ASCII character RS (ASCII value 30). The RS character after the secondary message is optional. If the AllowEscape property is set to true, you can use the "\r" instead of the RS character.
      • {GS}: ASCII character GS (ASCII value 29). It's used to delimit each field in barcode text. The GS character after the service class can be omitted if secondary message doesn't exist. If the AllowEscape property is set to true, you can use the "\g" instead of the GS character.
      • {EOT}: Optional ASCII character EOT (ASCII value 4). If the AllowEscape property is set to true, you can use the "\t" instead of the EOT character.

      For example (Date: 96; Postal code: 123456789; Country code: 840; Service class: 001; Secondary message: 'PA USA' + Chr(29) + 'UPS\123'):

      • '[)>' + Chr(30) + '01' + Chr(29) + '96123456789' + Chr(29) + '840' + Chr(29) + '001' + Chr(29) + 'PA USA' + Chr(29) + 'UPS\123' + Chr(30) + Chr(4)
      • '[)>\r01\g96123456789\g840\g001\gPA USA\gUPS\\123\r\t'
    • PPPPPPPPP{GS}CCC{GS}SSS{GS}MESSAGE{EOT}

      • PPPPPPPPP: Numeric postal code, up to 9 digits. Only first 9 digits will be encoded if its length is greater than 9 digits.
      • CCC: Country code, 3 digits.
      • SSS: Serivce class, 3 digits
      • MESSAGE: Optional secondary message. All 256 of the ASCII characters can be used. A maximum of about 82 alphanumeric characters or about 121 digits can be encoded in the message.
      • {GS}: ASCII character GS (ASCII value 29). It's used to delimit each field in barcode text. The GS character after the service class can be omitted if secondary message doesn't exist. If the AllowEscape property is set to true, you can use the "\g" instead of the GS character.
      • {EOT}: Optional ASCII character EOT (ASCII value 4). If the AllowEscape property is set to true, you can use the "\t" instead of the EOT character.

      For example (Postal code: 123456789; Country code: 840; Service class: 001; Secondary message: 'PA USA' + Chr(29) + 'UPS\123'):

      • '123456789' + Chr(29) + '840' + Chr(29) + '001' + Chr(29) + 'PA USA' + Chr(29) + 'UPS\123' + Chr(4)
      • '123456789\g840\g001\gPA USA\gUPS\\123\t'
  • Mode 3: It encodes a structured carrier message with an alphanumeric postal code, and an optional secondary message. An alphanumeric postal code, a country code, and a class of service code assigned by the carrier are included in the structured carrier message.

    The symbol employs enhanced error correction for the structured carrier message and standard error correction for the secondary message, see also the "Error checking and correcting (ECC)" section below.

    It is designed for use in the transport industry. Primary use is international destinations.

    The mode 3 is similar to mode 2, but the postal code field encodes 6 alphanumeric characters.

    The formats of mode 3 barcode text are specified in the following list:

    • [)>{RS}01{GS}YYPPPPPP{GS}CCC{GS}SSS{GS}MESSAGE{RS}{EOT}

      • YY: Date (year), 2 digits.
      • PPPPPP: Alphanumeric postal code, up to 6 alphanumeric characters. Only first 6 characters will be encoded if its length is greater than 6 characters. All upper case letters, all numeric characters, space character, and the punctuations and symbols corresponding to the ASCII values from 34 to 58 can be encoded.
      • CCC: Country code, 3 digits.
      • SSS: Serivce class, 3 digits
      • MESSAGE: Optional secondary message. All 256 of the ASCII characters can be used. A maximum of about 71 alphanumeric characters or about 107 digits can be encoded in the message.
      • {RS}: ASCII character RS (ASCII value 30). The RS character after the secondary message is optional. If the AllowEscape property is set to true, you can use the "\r" instead of the RS character.
      • {GS}: ASCII character GS (ASCII value 29). It's used to delimit each field in barcode text. The GS character after the service class can be omitted if secondary message doesn't exist. If the AllowEscape property is set to true, you can use the "\g" instead of the GS character.
      • {EOT}: Optional ASCII character EOT (ASCII value 4). If the AllowEscape property is set to true, you can use the "\t" instead of the EOT character.

      For example (Date: 96; Postal code: ABC12; Country code: 840; Service class: 001; Secondary message: 'PA USA' + Chr(29) + 'UPS\123'):

      • '[)>' + Chr(30) + '01' + Chr(29) + '96ABC12' + Chr(29) + '840' + Chr(29) + '001' + Chr(29) + 'PA USA' + Chr(29) + 'UPS\123' + Chr(30) + Chr(4)
      • '[)>\r01\g96ABC12\g840\g001\gPA USA\gUPS\\123\r\t'
    • PPPPPP{GS}CCC{GS}SSS{GS}MESSAGE{EOT}

      • PPPPPP: Alphanumeric postal code, up to 6 alphanumeric characters. Only first 6 characters will be encoded if its length is greater than 6 characters. All upper case letters, all numeric characters, space character, and the punctuations and symbols corresponding to the ASCII values from 34 to 58 can be encoded.
      • CCC: Country code, 3 digits.
      • SSS: Serivce class, 3 digits
      • MESSAGE: Optional secondary message. All 256 of the ASCII characters can be used. A maximum of about 82 alphanumeric characters or about 121 digits can be encoded in the message.
      • {GS}: ASCII character GS (ASCII value 29). It's used to delimit each field in barcode text. The GS character after the service class can be omitted if secondary message doesn't exist. If the AllowEscape property is set to true, you can use the "\g" instead of the GS character.
      • {EOT}: Optional ASCII character EOT (ASCII value 4). If the AllowEscape property is set to true, you can use the "\t" instead of the EOT character.

      For example (Postal code: ABC12; Country code: 840; Service class: 001; Secondary message: 'PA USA' + Chr(29) + 'UPS\123'):

      • 'ABC12' + Chr(29) + '840' + Chr(29) + '001' + Chr(29) + 'PA USA' + Chr(29) + 'UPS\123' + Chr(4)
      • 'ABC12\g840\g001\gPA USA\gUPS\\123\t'
  • Mode 4:

    Indicates that the symbol encodes an unformatted message. The barcode message is divided into a primary message and a secondary message internally, the symbol employs enhanced error correction for the primary message and standard error correction for the secondary message.

    All 256 of the ASCII characters can be used. A maximum of about 93 alphanumeric characters or about 138 digits can be encoded in the symbol.

  • Mode 5:

    Indicates that the symbol encodes an unformatted message. The barcode message is divided into a primary message and a secondary message internally, the symbol employs enhanced error correction for both the primary and secondary messages.

    All 256 of the ASCII characters can be used. A maximum of about 77 alphanumeric characters or about 113 digits can be encoded in the symbol.

    The mode 5 is similar to mode 4, but it employs enhanced error correction for secondary messages.

  • Mode 6:

    Indicates that the symbol encodes a message used to program the reader system. The barcode message is divided into a primary message and a secondary message internally, the symbol employs enhanced error correction for the primary message and standard error correction for the secondary message.

    All 256 of the ASCII characters can be used. A maximum of about 93 alphanumeric characters or about 138 digits can be encoded in the symbol.

You can use the Mode property to specify the factual mode for a MaxiCode symbol.

Also, you can set the AutoMode property to true, in order to automatically select the suitable mode depending on the barcode text and the value of Mode property. And use the CurrentMode property to get the factual mode:

  • If the Mode property is set to mode 2 or 3, the factual mode will be selected between mode 2 and 3, depending on the postal code field in the barcode text.
  • If the Mode property is set to mode 4, the factual mode will be selected between mode 4 and 5, depending on the length of barcode text. If the length of barcode text is so short that can be encoded by using mode 5, the mode 5 will be used in order to employ enhanced error correction, otherwise the mode 4 will be used in order to accommodate more barcode text.
  • If the Mode property is set to mode 5, the mode 5 will be selected always, in order to insure high level of enhanced error correction.
  • If the Mode property is set to mode 6, the mode 6 will be selected always, in order to encodes a message used to program the reader system.

Symbol size

Each MaxiCode symbol is of a fixed size, having 884 hexagonal modules arranged in 33 rows around a central finder pattern. Each row consists of a maximum of 30 modules.

Also, each symbol, including the quiet zones, is of a fixed physical size, nominally 28.14mm wide, 26.91mm high. Each hexagonal dot (module) measures 0.889 * 1.041 millimeters.

Error checking and correcting (ECC)

MaxiCode symbology offer two levels of error checking and correction, Enhanced Error Correction (EEC) and Standard Error Correction (SEC), which are specified by the Mode, see also the "Modes" section above.

In mode 2 and 3, the symbol employs EEC for the structured carrier message and SEC for the secondary message. In mode 4, 5, and 6, MaxiCode symbols are internally divided into a primary message and a secondary message, the mode 4 and 6 symbol employ EEC for the primary message and SEC for the secondary message. the mode 5 symbol employs EEC for both the primary and secondary messages.

Character set

In mode 2, all numeric characters can be encoded in the country code, service class, and postal code fields. All 256 of the ASCII characters can be encoded in the secondary message.

In mode 3, all numeric characters can be encoded in the country code and service class fields, all upper case letters, all numeric characters, space character, and punctuations and symbols corresponding to the ASCII values from 34 to 58 can be encoded in the postal code field. All 256 of the ASCII characters can be encoded in the secondary message.

In mode 4, 5 and 6, All 256 of the ASCII characters can be encoded in the entire message.

The default interpretation of these characters shall be:

  • Values 0-127, in accordance with ANSI X3.4, i.e. all 128 ASCII characters
  • values 128-255 in accordance with ISO 8859-1: Latin Alphabet No. 1, i.e. extended ASCII characters.

This default interpretation corresponds to ECI 000003.

Escape sequences

If the AllowEscape property is set to true, following escape sequences are supported by the component, you can insert them to the barcode text:

  • \\: Insert a backslash to barcode text.
  • \f: Insert a FS character (ASCII value 28) to barcode text. See also the "Modes" section above.
  • \g: Insert a GS character (ASCII value 29) to barcode text. See also the "Modes" section above.
  • \r: Insert a RS character (ASCII value 30) to barcode text. See also the "Modes" section above.
  • \t: Insert a EOT character (ASCII value 4) to barcode text. See also the "Modes" section above.
  • \e[<ECI_Number>]: Insert an ECI indicator block to barcode text. See also the "Extended Channel Interpretation (ECI)" section below.
  • \s[<Index>, <Amount>]: Insert a structured append block to barcode text in order to create the symbol in a structured append. See also the "Structured append" section below.

Extended Channel Interpretation (ECI)

The Extended Channel Interpretation (ECI) protocol allows the output data stream to have interpretations different from that of the default character set. Four broad types of interpretations are supported in MaxiCode:

  • International character sets (or code pages).
  • General purpose interpretations such as encryption and compaction.
  • User defined interpretations for closed systems.
  • Control information for structured append in unbuffered mode.

The ECI protocol provides a consistent method to specify particular interpretations on byte values before printing and after decoding. The ECI is identified by an integer (up to 6 digits) which is encoded in the MaxiCode symbol by the ECI indicator block. The escape sequence "\e[ECI_Number]" is used to place the ECI indicator block to the barcode text:

  • ECI_Number: The ECI number, it's an integer between 0 and 999999 (including the boundaries), the leading zero is optional.

ECI indicator blocks may be placed anywhere in the barcode text in a single or structured append set of MaxiCode symbols, but cannot be within the primary message (structured carrier message) for modes 2 and 3:

  • In mode 2 and 3, the ECI blocks may only be invoked within secondary message. For example:

    [)>01\r01\g99123456789\g123\g456\g\e[002]ABCg\e[123]DEF\r\t

  • In mode 4, 5 and 6, the ECI blocks may be invoked anywhere in the barcode text. For example:

    ABC\e[23]DEFG\e[001]HIJKLMN

The AllowEscape property should be set to true in order to place the ECI indicator blocks. Any ECI invoked shall apply until the end of the barcode text, or until another ECI indicator block is encountered. Thus the interpretation of the ECI may straddle two or more symbols.

Structured append

Up to eight MaxiCode symbols may be appended in a structured format to convey more data. If a symbol is part of a structured append this shall be indicated by a structured append block in barcode text. The escape sequence "\s[<Index>, <Amount>]" is used to place the structured append block to the barcode text:

  • Index: The position index of the symbol within the set of MaxiCode symbols in the structured append format. It's an integer between 1 and 8 (including the boundaries) in string format.
  • Amount: The total amount of the symbol within the set of MaxiCode symbols in the structured append format. It's an integer between 2 and 8 (including the boundaries) in string format.

The structured append block may only be placed once in the barcode text. The OnInvalidChar event will occur if the structured append block be placed more than once. The AllowEscape property should be set to true in order to place the structured append block. The valid locations for structured append block in the barcode text are specified in the following:

  • In the mode 2 and mode 3 of MaxiCode symbols, the structured append block shall be placed at beginning or end in the barcode text, or anywhere in the secondary message. For example:

    \s[2,5][)>01\r01\g99123456789\g123\g456\gABCDEF\r\t

    [)>01\r01\g99123456789\g123\g456\g\s[2,5]ABCDEF\r\t

    [)>01\r01\g99123456789\g123\g456\gABC\s[2,5]DEF\r\t

    [)>01\r01\g99123456789\g123\g456\gABCDEF\s[2,5]\r\t

    [)>01\r01\g99123456789\g123\g456\gABCDEF\r\t\s[2,5]

  • In the mode 4, 5 and 6 of MaxiCode symbols, the structured append block can be placed at anywhere in the barcode text. For example:

    \s[2,5]ABCDEFG

    ABC\s[2,5]DEFG

    ABCDEFG\s[2,5]