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.
| Property | Value | In context |
|---|---|---|
| Minimum X-dimension | 0.19 mm | 0.0075 in · 7 thou |
| Quiet zone | 10 modules | 1.90 mm at the minimum X-dimension |
| Dimensionality | Linear (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.
| Resolution | Narrow bar in dots | Printed as | Rounding error |
|---|---|---|---|
| 203 dpi | 1.52 | 2 dots | 32% |
| 300 dpi | 2.24 | 2 dots | 11% |
| 600 dpi | 4.49 | 4 dots | 11% |
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
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.