Code 128 is a high-density linear barcode symbology designed to encode alphanumeric characters. |
It is widely used in logistics and transportation industries due to its compact size and versatility. Code 128 can encode all 128 ASCII characters and includes three subsets or subtypes: Code 128A, Code 128B, and Code 128C. Each subset serves a specific purpose and encodes different types of data. |

|
128A (Code Set A) - ASCII characters 00 to 95 (0-9, A-Z and control codes), special characters, and FNC 1-4 128B (Code Set B) - ASCII characters 32 to 127 (0-9, A-Z, a-z), special characters, and FNC 1-4 128C (Code Set C) - 00-99 (encodes two digits with a single code point) and FNC1 |
Code 128 includes 108 symbols: 103 data symbols, 3 start symbols, and 2 stop symbols. Each symbol consists of three black bars and three white spaces of varying widths. All widths are multiples of a basic 'module'. Each bar and space is 1 to 4 modules wide, and the symbols are fixed width: the sum of the widths of the three black bars and three white bars is 11 modules. |
The stop pattern is composed of two overlapped symbols and has four bars. The stop pattern permits bidirectional scanning. When the stop pattern is read left-to-right (the usual case), the stop symbol (followed by a 2-module bar) is recognized. When the stop pattern is read right-to-left, the reverse stop symbol (followed by a 2-module bar) is recognized. A scanner seeing the reverse stop symbol then knows it must skip the 2-module bar and read the rest of the barcode in reverse. |

|
Here's a detailed look at each subtype: |
1. Code 128A Character Set: ASCII characters 0 to 95 (Standard ASCII characters: A-Z, 0-9, and various symbols) Control characters (ASCII 0-31) such as tab, line feed, carriage return, etc. Applications: Used for encoding uppercase letters, digits, and control characters. Ideal for applications that need to encode machine-readable control characters along with uppercase text. Details: Includes special characters for shifting to other subsets. Uses a compact encoding scheme to reduce the length of the barcode. |
2. Code 128B Character Set: ASCII characters 32 to 127 (Standard ASCII characters: A-Z, a-z, 0-9, and various symbols) Applications: Used for encoding both uppercase and lowercase letters, digits, and standard punctuation. Commonly used in labeling and packaging where a combination of text and numbers is required. Details: More versatile than Code 128A, allowing for a wider range of characters. Suitable for general-purpose text encoding. |
3. Code 128C Character Set: Pairs of digits (00-99) Applications: Specifically designed for encoding numerical data efficiently. Used in applications where space is limited and numeric-only data needs to be encoded, such as shipping labels and logistics tracking. Details: Encodes two digits per character, making it the most compact and space-efficient subset for numeric data. Provides a significant reduction in barcode length for numeric-only data compared to Code 128A and Code 128B. |

|
Switching Between Subsets |
Code 128 allows for switching between subsets within a single barcode. This is achieved using special shift and switch characters embedded within the data. For instance, if a barcode starts with letters (using Code 128B) but then needs to encode a long series of numbers, it can switch to Code 128C to shorten the barcode. |
Checksum and Start/Stop Characters |
Code 128 includes a mandatory checksum character at the end of the data to ensure data integrity. Each barcode starts with a specific start character (Start A, Start B, or Start C) to indicate which subset is initially used and ends with a universal stop character. |

|
Advantages of Code 128 |
High data density: Can encode a large amount of data in a relatively small space. Flexibility: Ability to switch between subsets makes it suitable for a wide range of applications. Error detection: The checksum ensures that the data is accurately read by scanners. |

|
Common Uses |
Shipping and receiving labels Inventory and asset management Identification cards Product identification in retail |

|
By understanding these subtypes and their specific use cases, businesses can effectively utilize Code 128 barcodes to meet their data encoding needs. |