SourceForge Project Page


also known as: UCC/EAN-128, GS1-128


The configuration for the default implementation is:

      <quiet-zone enabled="{boolean:true}">{length:10mw}</quiet-zone>


  • EAN-128 is based on the Code 128 symbology.
  • The height should be at least 0.15 times the barcode's length or 0.25 inches.
  • The "template" value is normally optional. The implementation will attempt to identify the correct template by inspecting the AI (application identifier). There's a table of predefined application templates built-in.
  • The format of "template" is a repeating set of AI number (in brackets) followed by a field description. The allowed data types are "n" (numeric), "an" (alpha-numeric), "d" (date) and "cd" (check digit). "cd" will calculate the check digit starting with the first character after the AI. "cd0" will include the AI in the check digit calculation (used for USPS). Multiple field parts can be separated by "+" characters.
  • Examples: "n13" defines a numeric field with exactly 13 digits. "n13+cd" defines a numeric field with exactly 13 digits plus a check digit. "an1-9" defines an alpha-numeric field with 1 to 9 characters. An example: "(01)n13+cd(421)n3+an1-9(10)an1-20"
  • "group-separator" defines the group separator character you will use in your message. By default, ASCII <GS> (0x1D, 035) or 0xF1 are recognized as group separators. In XSL-FO applications 0xF1 may have to be used instead of ASCII <GS>.
  • "check-digit-marker" represents the character in your message you will use as place-holder for a check digit that will be automatically calculated by Barcode4J.
  • If "omit-brackets" is set to true, no brackets will be put around AIs in the human-readable part.

Message format

  • Valid characters: The full 7 bit ASCII (US-ASCII) character set is supported
  • Functions 1 and 3 may be used. They are encoded as ASCII characters 0xF1 (241), 0xF3 (243) in the message.