Code 128 Symbology Manual: ISO/IEC 15417 Specifications, Subsets & Scannability
Introduced by Computer Identics Corporation in 1981 and standardized globally under ISO/IEC 15417, Code 128 is widely recognized as the most versatile, high-density linear barcode in modern industrial computing. Unlike older legacy symbologies such as Code 39 (which requires wide inter-character gaps and represents only 43 characters) or Interleaved 2 of 5 (which is restricted to numeric pairs), Code 128 can encode all 128 characters of the standard 7-bit ASCII table using a four-bar/four-space modular structure with built-in bidirectional scanning capability.
The Anatomy of a Code 128 Symbol
Every Code 128 barcode consists of six discrete components arranged from left to right:
- Left Quiet Zone: A blank white margin measuring at least 10X (ten times the narrow bar width) or 0.25 inches.
- Start Character: A unique 11-module pattern designating whether the symbol begins in Subset A, Subset B, or Subset C.
- Data Characters: Each encoded character occupies exactly 11 modules composed of 3 bars and 3 spaces (except the stop pattern). The sum of bar widths is always even, and space widths always odd, enabling the scanner to perform instant parity self-checking.
- Modulo 103 Check Character: A mathematically calculated symbol verifying complete optical scan integrity.
- Stop Pattern: A 13-module pattern composed of 4 bars and 3 spaces with a final termination bar.
- Right Quiet Zone: A blank margin measuring at least 10X or 0.25 inches.
Automatic Subset Optimization: A, B, and C
The secret to Code 128's extreme spatial density is its dynamic character set shifting:
| Subset | Character Range | Primary Industry Use |
|---|---|---|
| Subset A | ASCII 00 to 95 (Digits, Uppercase, Control Characters like CR, LF, TAB) | Industrial automation, PLC robotics, serial command inputs |
| Subset B | ASCII 32 to 127 (Digits, Uppercase, Lowercase, Punctuation) | Inventory SKUs, serial numbers, mixed alphanumeric tracking |
| Subset C | 100 Digit Pairs (00 to 99) encoded into single 11-module characters | GS1-128 shipping container codes, postal tracking numbers |
LabelQueue's native bwip-js engine evaluates your input string and automatically inserts optimal shift and latch codes. For example, if you enter an alphanumeric prefix followed by 10 digits (e.g. “INV-9812401824”), the engine renders “INV-” in Subset B and switches dynamically to Subset C for the numerical sequence, shrinking the physical barcode footprint by up to 35%.
Print Verification & Scanner Compatibility
To maintain an ISO/IEC 15416 print quality grade of A or B (readability rate above 99.5%):
- Avoid Scaling Distortions: Never scale barcode bitmap images non-proportionally in desktop publishing tools. LabelQueue outputs direct vector SVG and vector PDF, guaranteeing that narrow bars and wide bars maintain their strict integer ratios.
- Respect Narrow Bar Dimensions (X-Dimension): For handheld retail and warehouse scanners, maintain an X-dimension between 10 mil and 15 mil (0.25 mm to 0.38 mm). Very fine 5 mil barcodes require high-resolution 600+ DPI imagers.
- Ensure Adequate Bar Height: Ensure bar height is at least 15% of the total symbol length or 0.25 inches (6.3 mm), allowing laser raster lines to intersect all bars during angled scanning.