Code 128 Tech Support
Code 128

Relationship of Symbol Character Value to ASCII Value in Code 128

In Code 128, the symbol character value (represented by "S") is different from ASCII decimal value. Someone may wonder: Is there a relationship of symbol character value to ASCII decimal value in Code 128? Can we use a formula to calculate the ASCII decimal value by knowing the symbol character value? The answer is yes.
The following formulas can help you convert ASCII decimal value to symbol character value (S) or vice versa. Specially, these formulas are applicable for Code Set A and Code Set B.

Dimensional Characteristics of Code 128

The width of Code 128 barcode image may be different because of the general application needs, the availability of suitable symbol production and reading equipment may be different. As the X dimension (the width of a narrow element) affect the width of Code 128 much, users can refer to a value or a range of values of X dimension recommend in ISO/IEC Code 128 15417-2007.
Users can calculate the width of a Code 128 symbol (including minimum quiet zones) by the following formula:
W = 11X [ C + (D÷2) ] + 22X

W: is the width of the symbol;

X: is the width of a narrow element;

C: is the number of Start, special, symbol check and Stop characters plus the number of data characters not included in D;

D: is the number of numeric data characters encoded in double density (Code Set C).

Code Sets of Code 128

Code 128 has three code sets: Code Set A, Code Set B, Code Set C. The Start Character, code A, code B, or code C characters, or the shift character determine the choice of code set. Code set A can be defined initially as long as the symbol starts with Start Character A. Code set B and Code set C are similarly defined by beginning the symbol with Start Character B or C respectively. Code A, Code B, and Code C characters or the shift character can redefine the code set within the symbol.
Code sets A, B and C do not encode the same kind of characters. In the following part, you can see what characters they can encode respectively in detail.
  • Code set A: all of the standard upper case alphanumeric characters, punctuation character, the symbology elements and seven special characters.
  • Code set B: all of the standard upper case alphanumeric characters and punctuation characters together with the lowercase alphabetic characters and seven special characters.
  • Code set C: the set of 100 digit pairs from 00 to 99 inclusive, as well as three special characters.