Code sets A, B and C
Code 128 switches between three code sets to fit different kinds of data efficiently. Set A covers uppercase letters, digits and control characters; set B covers uppercase and lowercase letters, digits and punctuation; set C packs two digits into each symbol character, which makes long numbers very compact.
Each symbol character is 11 modules wide, made of 3 bars and 3 spaces, and the stop pattern is 13 modules. An encoder can switch sets in the middle of a barcode to keep it as short as possible.
The check character
Every Code 128 barcode ends with a mandatory check character. It is calculated by adding the start character’s value to the sum of each data character’s value multiplied by its position, then taking the remainder after dividing by 103. The check character is not shown in the human-readable text.
GS1-128 in logistics
GS1-128 is Code 128 with an FNC1 character after the start, which marks the content as GS1 Application Identifiers. It is the standard linear barcode on shipping and pallet labels, where it often carries an SSCC (Application Identifier 00) along with GTINs, batch numbers and dates.
Code 128 is specified in ISO/IEC 15417 and is widely used for shipping, warehousing and internal labels.