xBarcodexBarcode
ISO STANDARD: ISO/IEC 15417:2007

Code 128 Barcode Standard & Generator

A high-density alphanumeric barcode. Our engine uses dynamic lookup algorithms to automatically switch between Subsets A, B, and C for the shortest possible symbol width.

Try CODE128 Generator →

Technical Specifications

Structure Start Pattern + Data Codewords (auto-switched) + Checksum (Modulo 103) + Stop Pattern + Quiet Zone
Capacity Variable length (theoretically unlimited, practical limit ~48 chars per standard width)
Character Set Full ASCII 128 characters (using Subsets A, B, C)

Common Applications

This standard is widely used in the following industries:

Logistics, Shipping Labels (GS1-128), Inventory Tracking, Product Labels

The Science Inside

How our Rust engine optimizes this specific format:

Dynamic-programming encoder guarantees the minimum Code 128 codeword sequence across Sets A/B/C.

  • Pre-tokenization understands {FNC1}...{FNC4} and ~1...~4 syntax (~~ escapes a literal ~) and validates encodability.
  • Mode C pairs digits to pack 00-99 into one codeword; SHIFT and CODE transitions are costed in DP.
  • GS1 mode injects FNC1 immediately after the START code and treats lone ~ separators as FNC1.
  • Extended ASCII (128-255) is supported via FNC4 with set-specific mappings.
  • Checksum and STOP code generation follow the Code 128 spec exactly.