Code 128Linear (1D)Introduced 1981

Code 128

A high-density, variable-length linear barcode that encodes all 128 ASCII characters, and the backbone symbology of modern logistics.

Code 128 Specification

Character setAll 128 ASCII characters: 0-9, A-Z, a-z, punctuation, and control characters (code set dependent)
Data lengthVariable; no fixed minimum or maximum — bounded only by available label width
Check digitMandatory Mod 103 check character, calculated automatically by the encoder
Density≈12 alphanumeric or ≈24 numeric characters per inch at the minimum 0.19 mm X-dimension (code set C packs 2 digits per symbol character)
Module width (X-dimension)0.19-0.50 mm typical; 0.25-0.40 mm is the common production range
Print ratioVariable-width bars and spaces (no fixed wide:narrow ratio)
MagnificationNot fixed by the standard; size scales linearly with the chosen X-dimension
Quiet zone10X on each side (minimum 2.5 mm recommended for general scanning)
StandardISO/IEC 15417; GS1 General Specifications (GS1-128 variant)
OriginTed Williams, Computer Identics, 1981
Sample dataABC-abc-1234

Try It: Generate a Code 128 Barcode

This live generator is preconfigured for Code 128. Adjust size, colors, and text — then download as PNG or SVG. Free, no signup, all encoding happens in your browser.

Open the full Code 128 generator →

What Is Code 128?

Code 128 is a high-density, variable-length linear barcode symbology defined by ISO/IEC 15417. Each symbol character is built from 11 modules arranged into six elements (three bars and three spaces, each 1-4 modules wide), and the full symbol is wrapped by a unique start pattern, a mandatory Mod 103 check character, and a stop pattern of 13 modules. Because it can express all 128 ASCII values, Code 128 handles mixed-case text, punctuation, and control characters in a single symbol — something neither Code 39 nor ITF can do.

Its defining strength is density. Code 128 (auto mode) switches between three internal code sets — A, B, and C — within one barcode to keep the symbol as narrow as possible. Code set C packs two digits into every symbol character, halving the width of purely numeric data such as serial numbers and SSCCs. Combined with its mandatory check character and self-checking structure, this makes Code 128 the default general-purpose 1D barcode across shipping, warehousing, retail internals, and healthcare labeling. GS1-128, the application-standard variant carrying GS1 Application Identifiers, is built directly on it.

Common Applications

  • Shipping and parcel labels (tracking numbers, SSCC carton codes)
  • Warehouse inventory and internal SKU labels
  • Healthcare patient, specimen, and medication labeling
  • Asset tracking and document control

Code 128 FAQ

How is the Code 128 check character calculated?

Every Code 128 symbol carries a Mod 103 check character computed as the weighted sum of the start code value (103, 104, or 105), each data character value multiplied by its 1-based position, and the result reduced modulo 103. The encoder appends this character automatically — you must never type it as part of your data. Scanners recompute the sum on every read and reject symbols where it does not match.

What do the start, stop, and FNC1 characters do in Code 128?

The start character (Start A/B/C) tells the scanner which code set the symbol begins in and is also invisible in the transmitted data. The 13-module stop pattern uniquely ends the symbol. FNC1 is a special function character: when placed in the first position it signals a GS1-128 symbol with Application Identifier data, and elsewhere it acts as a code-set separator in GS1 strings.

How wide will my Code 128 barcode be?

Width depends on character mix and X-dimension. Each symbol character occupies 11 modules, plus 11 for start, 11 for the check character, and 13 for stop. Alphanumeric data in code set B needs 11 modules per character, while digits in code set C need only 5.5 modules per digit. At a 0.33 mm X-dimension, a 10-digit numeric value is roughly 40 mm wide including quiet zones.