Code 128 so với Data Matrix
Code 128 is decoded by every linear scanner in service and holds roughly eighty characters in a wide, short symbol. Data Matrix holds 2,335 characters in a fraction of the area and recovers from heavy damage, but requires an imaging reader. Reader estate rather than capacity is the deciding constraint in most deployments.
Specification comparison
| Specification | Code 128 | Data Matrix |
|---|---|---|
| Classification | 1D Linear | 2D Matrix |
| Symbology family | Code Family | 2D Matrix Family |
| Year introduced | 1981 | 1987 |
| Developer | Computer Identics | RVSI Acuity CiMatrix |
| Data length | variable (1-80 characters) | variable |
| Variable length | Yes | Yes |
| Character set | Full ASCII 128 | Full ASCII + binary data |
| Maximum capacity | 80 characters (practical limit) | 2,335 alphanumeric or 3,116 numeric characters |
| GS1 data carrier | No | No |
| Unicode encoding | No | No |
| Binary data | No | Yes |
| Minimum X-dimension | 0.25 mm | 0.254 mm |
| Nominal height | 15 mm | — |
| Quiet zone | 10X | 1 module |
| Aspect ratio | — | 1:1 (square) or rectangular |
| Example payload | BarcodeFYI-2026 | DataMatrix2026 |
| Reader type required | Laser scanner or imager | Imager only |
| Practical payload | About 80 characters | 2,335 alphanumeric characters |
| Damage recovery | Vertical redundancy across bar height | Reed-Solomon, up to 30 percent of symbol area |
| GS1 structured form | GS1-128, capped at 48 characters | GS1 DataMatrix, no comparable cap |
| Direct part marking | Not applicable | Dot peen, laser etch, chemical etch |
Highlighted rows mark specifications where the two symbologies differ.
One dimension against two
A linear symbology encodes along a single axis, so width grows with every character while height contributes only redundancy: scanning any horizontal line across the symbol recovers the whole payload. Code 128 exploits that redundancy, which is why a torn or partly obscured label often still reads. Growth is the limitation, and around eighty characters a Code 128 symbol exceeds the width of a standard shipping label.
Data Matrix distributes data across both axes. Doubling the payload increases the side length by roughly the square root of two rather than doubling the width, so 2,335 alphanumeric characters fit an area no linear symbol could approach. The redundancy a linear code gets from its height is replaced by explicit Reed-Solomon correction, which recovers a symbol damaged across as much as 30 percent of its area.
Reader requirements
This constraint decides most projects. A laser scanner sweeps a line and decodes any linear symbology it crosses, and it cannot read a two-dimensional matrix at all. Reading Data Matrix requires an imaging reader that captures a two-dimensional field and processes it in software. Imagers are now inexpensive and read linear codes as well, but a warehouse, hospital, or retail estate holding thousands of installed laser scanners cannot switch data carrier without replacing them.
Print quality and verification
Code 128 tolerates a 0.25 mm bar or space; fundamental sizing unit." data-category="Barcode Anatomy & Structure">X-dimension on ordinary thermal transfer stock. Data Matrix at a 0.254 mm module demands tighter control of print gain, because a cell bleeding into its neighbour is not recoverable the way a slightly wide bar is. Both are graded against the ISO/IEC 15416" data-definition="International standard grading linear barcode print quality A-F." data-category="Printing & Quality">ISO/IEC 15416 and 15415 verification methods respectively, and a Data Matrix mark applied by dot peen or laser is graded under a separate direct part marking method.
Data structure
Neither symbology defines a data structure on its own. Code 128 becomes a structured carrier as gs1-128-term/" class="glossary-term-link" data-term="GS1-128" data-definition="Code 128 subset with GS1 Application Identifiers for supply chains." data-category="1D Linear Symbologies">GS1-128, where an FNC1 prefix and Application Identifiers describe each element, and Data Matrix becomes one as GS1 DataMatrix under the same convention. Where a GTIN, batch, expiry date, and serial number must travel together, the GS1 variant of either carrier holds them, but GS1-128 caps a symbol at 48 characters while GS1 DataMatrix has no comparable ceiling.
Which to choose
Choose Code 128
- Laser scanners make up a substantial share of the installed reader base.
- The payload is short, typically a GTIN with one or two additional elements.
- Labels are printed on standard thermal transfer stock without close print-gain control.
Choose Data Matrix
- The payload exceeds what a linear symbol can hold in the available width.
- Available marking area is measured in millimetres.
- The symbol is applied directly to a part rather than to a label.
- Serialisation requires a GTIN, batch, expiry date, and unique serial in one carrier.
Recommendation
Where imagers are already deployed and area is constrained, Data Matrix carries far more data in less space with better damage tolerance. Where laser scanners remain in service, Code 128 is the only one of the two that every reader can decode, and that fact normally settles the question before capacity is considered.