Linear Code 128 Barcode Introduction

A brief introduction of Code 128 barcode including Code 128a, Code 128b and Code 128c
Generate, Develop and Integrate Code 128 Images in .NET Applications
Terrek.com provides robust Code 128 barcode generator components DLL for developers who needs to integrate Code 128 barcode into .NET applications using various generation methods.
Code 128 Barcode Symbology Overview
Definition of Code 128
Code 128, a high-density linear symbology, was developed in 1981. It’s called Code 128 because it can encode all ASCII characters (0-127). It’s more complicated than other 1D code type, but it’s also more flexible because it has more available characters, and different methods of encodation.
Application of Code 128
  • A company’s internal management
  • Process of production
  • Shipping industry
  • Packaging industry
Barcode Specification of Code 128
  • ISO/IEC 15417 (2nd edition 2007-06-01)
  • ISO/IEC 8859-1(Latin Alphabet no. 1)
  • GSI-128
  • ISBT-128
  • USS Code 128
  • ISS Code 128
  • The Global Trade Item Number (GTIN)
  • SSCC-18
Code 128 Barcode Features Overview
  • Code 128 can encode all ASCII characters, including 0-127. Besides, it can encode characters with byte values 128-255. Remember, Code 128 has 4 non-data function characters (3 start characters and 1 stop character), and 4 code selection characters (Code A, Code B, Code C and a shift character).
  • The non-data characters, including a start character (11 modules), a symbol check character (11modules) and a stop character (13 modules), is equal to 35 modules.
  • It consists of 6 elements per symbol character, including 3 bars and 3 spaces. The width of each element is 1, 2, 3 or 4 modules. The total width of a symbol character is 11 modules, except the stop character, which has 7 elements containing 4 bars and 3 spaces, thus being 13 modules in width.
  • It’s a continuous barcode type and bi-directionally decodable. Its length is variable, with a total width no more than 232 modules, including the start and stop characters.
  • The parity feature of Code 128 that the total bar modules in any symbol character is always even while that of space modules is always odd enables its nature of self-checking. A symbol check character should be included in a Code 128 and its checksum digit calculation is based on a module 103 character. The check character shall not be shown in the human-readable data, nor transmitted by a decoder.
  • A Code 128 consists of, from left to right, a leading quiet zone, a start character, one or more data characters, a symbol check character, a stop zone and a trailing quiet zone.
Code 128 Barcode Dimension Overview
Nominal module width (X)
The width of a module depends on the application specification. And its width is written as X.
Barcode width (W)
We can use the next formula to calculate the total width (W) of a Code 128, including quiet zones (Q).
W = [11 (C + 2) + 2] X + 2Q, in which, C stands for the total number of symbol characters.
Code 128 Check Digit Calculation Example
To encode a Code 128 symbol, the checksum digit which will be included in the barcode should be calculated correctly. Following are steps for calculating the check digit:
  • Each symbol character position is given a weighting. The start character is weighted 1, and then from the left, the data character following the start character is weighted 1. Next are 2, 3, 4…n, in which n refers to the number of symbol characters representing data, not including Start/Stop character and the check character itself.
  • Multiply the value of each symbol character by its weighting.
  • Add up the results of the second step.
  • Divide the total number by 103. The remainder is the checksum digit which is appended to the end of the message.