What Code 128 is
Code 128 is a high-density linear symbology standardized as ISO/IEC 15417, encoding the full 128-character ASCII set via three switchable code sets (A, B, C).
Generate it now
No code set to choose -- type any mix of letters, digits, and symbols now and bwip-js switches Code Sets A/B/C automatically for the shortest valid symbol.
Valid input
Code 128 encodes any ASCII character; bwip-js automatically selects and switches code sets and computes the Modulo-103 checksum.
Key options
Supported options include includetext (human-readable text), height, and scale.
Output and printing
Export PNG for quick use or SVG for scalable, print-ready labels; keep a quiet zone on each side for reliable scanning.
Common uses
Code 128 is the workhorse of inventory, asset, warehouse, and shipping labels, and is also the base symbology underneath GS1-128.
Example
The seeded example, "Count01234567!", mixes letters, eight digits, and a symbol in one payload: bwip-js switches between Code Set B (letters/symbols) and Code Set C (digit pairs) mid-symbol to encode the digit run more densely, then switches back for the trailing "!" -- the kind of automatic code-set optimization Code 128 is built around.
Size guidance
Like other linear symbologies, Code 128 needs a clear quiet zone on both sides for reliable scanning.
Troubleshooting
If a scanner misreads the label, check for adequate quiet zone and print contrast before assuming a data problem.
Related formats
Related formats: GS1-128 (Code 128 with GS1 application identifiers), Code 93, and Code 39.
FAQ
Does Code 128 include a check digit?
Yes -- bwip-js computes the Modulo-103 checksum automatically as part of encoding.
Do I need to pick a code set (A, B, or C) myself?
No -- bwip-js analyzes the payload and switches between Code Set A (uppercase/control), B (mixed-case/symbols), and C (digit pairs) automatically to produce the shortest valid symbol; there is no code-set option to set.
What's the difference between this and GS1-128?
GS1-128 is Code 128 with a leading FNC1 that marks the payload as GS1 Application Identifier data (GTIN, lot, SSCC, and so on); the underlying bar pattern is drawn by the same Code 128 symbology, but the data structure and use case differ.