Skip to content
PrintMyLabels

Linear symbology

Code 128

Code 128 is a variable-length linear barcode that encodes the full ASCII character set, which makes it the usual choice for internal SKUs, carton IDs and anything that mixes letters with digits. It is dense for its capacity because it can pack two digits into a single character when the data is numeric.

Specification

These are the values the editor enforces while you design, not figures collected from elsewhere — the same numbers its quiet-zone and resolution checks run on.

Code 128 specification: minimum X-dimension, quiet zone and dimensionality
PropertyValueIn context
Minimum X-dimension0.19 mm0.0075 in · 7 thou
Quiet zone10 modules1.90 mm at the minimum X-dimension
DimensionalityLinear (1D)Read by laser or imager

Code 128 at 203, 300 and 600 dpi

A printer can only place whole dots, and 0.19 mm is not a whole number of them at any of these resolutions. What changes is how much a single dot of rounding costs you as a share of the narrow bar.

Code 128 narrow bar in printer dots at 203, 300 and 600 dpi
ResolutionNarrow bar in dotsPrinted asRounding error
203 dpi1.522 dots32%
300 dpi2.242 dots11%
600 dpi4.494 dots11%

What Code 128 encodes

All 128 ASCII characters, at any length. Three subsets — A, B and C — cover control characters, lower case and double-density digit pairs respectively; the encoder switches between them for you, so a numeric value takes roughly half the width of the same value in a symbology that cannot pair digits.

Where it is used

  • Internal SKU and part-number labels where the value is not a retail GTIN
  • Shipping and carton labels outside the GS1 application
  • Warehouse bin, location and tote identifiers

Check digit

A modulo-103 check character is mandatory and is calculated and inserted by the encoder. It is not part of your value and is not shown in the human-readable text, so a Code 128 barcode always carries one whether or not you asked for it.

How Code 128 fails in practice

  • Encoding a value that needs GS1 Application Identifiers as plain Code 128. The bars scan, but a GS1-aware system reads the result as an unstructured string rather than a GTIN — use GS1-128 for that.
  • Long values silently becoming very wide symbols. Code 128 has no fixed length, so a 40-character value produces a barcode that will not fit a small label at a readable X-dimension.
  • Lower-case letters pushing the encoder out of the double-density numeric subset, which makes an otherwise numeric value considerably wider.

When to use something else

  • GS1-128 — choose it instead when the value is GS1 data and needs Application Identifiers a trading partner can parse.
  • Code 39 — choose it instead when a legacy scanner or an older system specifically requires it, accepting the loss in density.

Questions about Code 128

Does Code 128 have a length limit?
Not a fixed one. Code 128 is variable-length, so the practical limit is physical: every additional character widens the symbol, and the barcode still has to fit the label at an X-dimension the scanner can read.
Why does the human-readable text not match the number of bars?
Code 128 adds a mandatory modulo-103 check character and start/stop characters that are part of the symbol but not part of your data. They are encoded in the bars and deliberately not printed in the text.