Code 128
Code 128 was invented in 1981 by Ted Williams of Laserlight Corporation to solve the problem of representing both alphabetic and numeric characters without sacrificing barcode density. Code 128 enables you to encode all 128 ASCII characters, as Code 39 - Full ASCII does. Additionally, when you encode only numbers, Code 128 can encode them more densely than Interleaved 2 of 5 does.
The most common use of Code 128 is for certain shipping labels, primarily as defined by GS1 in the GS1-128 barcode standard.
Code 128 is defined in ISO/IEC 15417 Information technology - Automatic identification and data capture techniques - Code 128 bar code symbology specification.
The symbol comprises the following elements:
Symbol characters: Most barcode symbologies print bars and spaces in only two widths (wide and narrow), but Code 128 uses four different widths, as the UPC/EAN family does. However, whereas the UPC/EAN family uses four elements (two bars and two spaces) per character, each Code 128 character is represented by six elements (three bars and three spaces). Although this represents a 50 percent reduction in character density, Code 128 can represent all 128 ASCII characters. Also, unlike UPC/EAN, Code 128 is not limited to numbers only.
Start character: Code 128 has three different start characters, one for each of the three character code sets: Code Set A, Code Set B, and Code Set C. The start character that will be used for a given barcode depends on what characters need to be encoded in that portion of the barcode.
Although a Code 128 character set itself contains only 102 characters, this symbology supports all 128 lower ASCII characters. This is possible because Code 128 uses three different sets of 102 characters: Code Set A, Code Set B, and Code Set C. The default code set that is in use for any Code 128 barcode is determined by the start character. However, it is possible to switch between the different character sets and use any combination of them in a single symbol. Because of this, Code 128 gives you the greatest possible character density when encoding data.
The three character code sets can be summarized as follows:
-
Code Set A: Includes all numeric values (0-9), uppercase alphabetic characters (A-Z), punctuation marks, seven special characters, and "control" characters (ASCII values 00 through 95).
-
Code Set B: Includes all numeric values (0-9), uppercase and lowercase alphabetic characters (A-Z, a-z), punctuation marks, and seven special characters (ASCII values 32 through 127).
-
Code Set C: Includes all numeric digit pairs from 00 through 99 and three special characters. This code set is numeric-only, but any one character actually represents two digits.
Code 128 contains a mandatory check digit that is based on the modulo 103 (mod 103) algorithm. The check digit appears just before the stop character. There is no human readable interpretation for the check digit.
The recommended minimum symbol height for manual scanning is 5.0 mm or 15 percent of the symbol width (excluding quiet zones), whichever is greater. The quiet zones must be at least 10X wide, where "X" is the current X dimension.
Code 128 supports the following special characters:
These characters instruct the barcode reader to enable special operations and applications.
GS1-128 (formerly known as UCC/EAN-128) is the name given to Code 128 barcodes that conform to the GS1 standards. Such barcodes include FNC1 characters, application identifiers, check digits, and extra spaces and parentheses in the human readable interpretation characters.