What is Code 128 Barcode

171 6
2026-07-18
Code 128 Barcode

Code 128 Barcode

Code 128 Barcode

Code 128 is a high‑density, variable‑length linear barcode standard introduced by Computer Identics Corporation in 1981 and later formalized as ISO/IEC 15417.

The name “128” reflects its ability to encode the full set of 128 ASCII characters (ASCII 0–127), including digits, uppercase and lowercase letters, punctuation marks, and system control characters.

Code 128 offers high data density, flexible encoding, and a mandatory built‑in check digit. This allows it to store large amounts of information in a compact space while significantly reducing scanning errors.

As an openly managed standard, Code 128 does not require global registration. It is primarily used for information identification and traceability within enterprise workflows and supply chain operations, and today it remains the most widely adopted general‑purpose barcode in industrial, logistics, and warehousing sectors.

Standard Encoding Structure of Code 128 Barcode

A complete Code 128 barcode is composed of six sequential parts arranged from left to right:

  1. Left Quiet Zone: A blank margin on the left side that prepares the scanner for reading. It must remain free of any patterns or text.
  2. Start Character: Indicates the beginning of the barcode and defines the initial character subset (Start A, Start B, or Start C). It consists of 11 modules (3 bars + 3 spaces).
  3. Data Area: Contains the encoded information. Each character is represented by 11 modules (3 bars + 3 spaces).
  4. Check Character: A mandatory check digit calculated using the Modulo 103 algorithm. The scanner validates data accuracy by comparing this value, significantly reducing misread errors.
  5. Stop Character: Marks the end of the barcode, composed of 13 modules (4 bars + 3 spaces). Its asymmetric stop pattern is a distinctive feature that enables bidirectional scanning.
  6. Right Quiet Zone: A blank margin on the right side that ensures the scanner correctly identifies the end of the code.

Three Character Subsets

Code 128 does not rely on a single code set to directly cover all 128 ASCII characters. Instead, it achieves full coverage by dynamically switching among three subsets, which can be toggled within a single barcode to optimize overall length.

SubsetCoverageTypical Use Cases
Subset A (Code 128A)ASCII 00–95: digits 0–9, uppercase letters A–Z, ASCII control characters (e.g., TAB, line feed), special symbols, and function characters FNC1–FNC4Industrial control, internal system coding, and scenarios requiring transmission of control characters
Subset B (Code 128B)ASCII 32–127: digits 0–9, uppercase and lowercase letters, all printable special symbols, and function characters FNC1–FNC4The most versatile subset, widely used for everyday text, product codes, material numbers, order numbers, and most general applications
Subset C (Code 128C)Numeric pairs 00–99: one code element encodes two digits, plus the FNC1 function characterLong numeric strings. Offers the highest density of the three subsets, requiring only half the length of other subsets for the same number of digits

Key Features of Code 128 Barcode

  • High Density: For the same data volume, Code 128 is about 30% shorter than Code 39. When encoding pure numeric data with Subset C, the length can be reduced by half, making it ideal for applications with limited label space.
  • Full ASCII Support: Through subset switching, Code 128 can encode all 128 ASCII characters, including digits, letters, symbols, and control characters.
  • Variable Length: The barcode has no fixed length constraint and can be flexibly adjusted to match the data size. In practice, a limit of 48 characters is generally recommended to ensure reliable scanning.
  • Mandatory Check Digit: Every Code 128 barcode includes a check character, providing stronger error detection than most one‑dimensional barcodes.
  • High Print Tolerance: Code 128 tolerates moderate variations in print quality and minor wear, and can be reliably produced using standard inkjet, thermal, or thermal transfer printers.

Common Applications of Code 128 Barcode

  • Logistics and Supply Chain: The most prominent application is GS1‑128 (formerly UCC/EAN‑128). Built on Code 128 encoding, it begins with the FNC1 character and uses Application Identifiers (AI) on shipping labels and waybills to record supply chain data such as batch numbers, production dates, expiration dates, and serial numbers.
  • Healthcare: Used for pharmaceutical labeling, specimen tags, and medical device traceability, as it can encode both numeric and textual information simultaneously.
  • Manufacturing and Warehousing: Applied to production line process control, inventory management, and asset coding. Its structure is well‑suited for automated scanning in factory environments.
  • Electronics Industry: Utilized for micro‑labels on PCB boards and small electronic components. Its high density allows reliable encoding in extremely compact spaces.

Supplement: Relationship Between GS1‑128 and Code 128

GS1‑128 is not an independent barcode format but an application standard based on Code 128. It requires the FNC1 function character as the leading symbol and standardizes data semantics through predefined Application Identifiers (e.g., AI 01 denotes the Global Trade Item Number, while AI 10 denotes a batch/lot number). This ensures consistent interpretation of barcode data across enterprises, making GS1‑128 a universal specification for international supply chains.

Code 128 barcode

Date + sequential number – good for production or shipping dates.

Date + sequential number – good for production or shipping dates.

Prefix + serial – handy for inventory tracking.

Prefix + serial – handy for inventory tracking.

Simple alphanumeric code – ideal for product numbers.

Simple alphanumeric code – ideal for product numbers.

“SN:” label plus a long serial, shows that the colon (: ) is also supported.

“SN:” label plus a long serial, shows that the colon (: ) is also supported.

Includes a special character (# ) to demonstrate symbol compatibility.

Includes a special character (# ) to demonstrate symbol compatibility.

All‑numeric and an even number of digits – can be encoded with Code 128‑C for higher density.

All‑numeric and an even number of digits – can be encoded with Code 128‑C for higher density.

Quiz

1/1
word
meaning
Excellent!
網址 QR Code (What is Code 128 Barcode)
本頁網址 QR Code
已複製到剪貼簿

條碼 barcode

倉頡/速成