Code 128

Also called: Code-128, GS1-128, UCC/EAN-128

Definition

Code 128 is a high-density linear barcode that can encode all 128 ASCII characters. It uses three code sets, A, B and C, and a mod-103 check character.

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.

Frequently asked questions

What is the difference between Code 128 and GS1-128?

GS1-128 is Code 128 with an FNC1 character at the start and data structured as GS1 Application Identifiers. Plain Code 128 can hold any ASCII text.

Can Code 128 encode lowercase letters?

Yes. Code set B covers lowercase letters, so Code 128 can encode the full ASCII character set.

Sources and standards

All terms