Code 128 vs Code 39
Code 128 encodes the same string in roughly half the width of Code 39 and covers the full 128-character ASCII range, whereas Code 39 reaches only 43 characters but verifies each character independently without a check digit. Symbol width settles most new specifications; Code 39 persists where a published standard or an installed reader requires it.
Specification comparison
| Specification | Code 128 | Code 39 |
|---|---|---|
| Classification | 1D Linear | 1D Linear |
| Symbology family | Code Family | Code Family |
| Year introduced | 1981 | 1974 |
| Developer | Computer Identics | David Allais & Ray Stevens (Intermec) |
| Data length | variable (1-80 characters) | variable (1-80 characters) |
| Variable length | Yes | Yes |
| Character set | Full ASCII 128 | A-Z, 0-9, - . $ / + % space |
| Maximum capacity | 80 characters (practical limit) | 80 alphanumeric characters (practical limit) |
| GS1 data carrier | No | No |
| Unicode encoding | No | No |
| Binary data | No | No |
| Minimum X-dimension | 0.25 mm | 0.19 mm |
| Nominal height | 15 mm | 15 mm |
| Quiet zone | 10X | 10X |
| Example payload | BarcodeFYI-2026 | HELLO2026 |
| Encoding scheme | Variable-width elements, 106-value alphabet, three character sets | Fixed three-of-nine wide and narrow elements |
| Character coverage | 128 ASCII values | 43 characters (A-Z, 0-9, - . $ / + % space) |
| Self-checking | No; modulo-103 check character | Yes, per character |
| Relative width, numeric payload | Baseline; Set C packs two digits per character | Approximately twice as wide |
| Named in published standards | GS1 logistics labelling, through GS1-128 | MIL-STD-129, AIAG labelling, several healthcare specifications |
Highlighted rows mark specifications where the two symbologies differ.
How each symbology encodes data
Code 39 draws every character as nine elements of which exactly three are wide. That fixed wide-to-narrow relationship makes each character independently verifiable, the property described as Symbology property ensuring single print errors are detectable." data-category="Barcode Anatomy & Structure">self-checking, and it is why the symbology shipped in 1974 without a mandatory check digit. Width is the cost: nine elements plus an inter-character gap for every character, whatever that character happens to be.
Code 128 replaces the fixed ratio with variable-width bars and spaces drawn from a 106-value alphabet, and splits that alphabet across three character sets. Set A covers upper-case letters and ASCII control characters, Set B covers the printable range including lower case, and Set C encodes two digits in one character. Shift and code characters switch sets mid-symbol, so a payload mixing text with long numeric runs uses whichever set is cheapest at each position. A modulo-103 check character closes the symbol.
Symbol width for the same payload
The practical consequence is that a numeric payload encoded in Code 128 Set C occupies roughly half the width of the same payload in Code 39. For mixed alphanumeric data the advantage narrows but does not disappear. Code 39 carries a further penalty in printing, because its wide elements must stay distinguishable from narrow ones at the available print quality; Code 128 is specified at a 0.25 mm minimum bar or space; fundamental sizing unit." data-category="Barcode Anatomy & Structure">X-dimension while Code 39 is commonly printed at 0.19 mm and still runs wider overall.
Where label width is fixed, that difference decides whether a payload fits at all. A fourteen-digit GS1 Standards & Identifiers">GTIN followed by a batch code and a date fits a standard logistics label in Code 128 and does not fit in Code 39.
Character coverage
Code 39 encodes 43 characters: A to Z, 0 to 9, and the symbols hyphen, period, dollar, slash, plus, percent, and space. Lower-case letters are absent. An extension known as Full ASCII Code 39 reaches the remaining values by pairing each with a shift symbol, which doubles the width of every extended character and is rarely worth the space it consumes. Code 128 addresses all 128 ASCII values natively.
Where each remains in service
United States defence labelling under MIL-STD-129, automotive labelling standards from the Automotive Industry Action Group, and several healthcare specifications named Code 39 when they were written, and installed equipment keeps it in circulation. Code 128 is the encoding beneath GS1-128, which makes it the linear carrier for Application Identifier data throughout global logistics. In plain form neither symbology is a GS1 data carrier.
Which to choose
Choose Code 128
- Label width is constrained and the payload mixes letters, digits, or lower case.
- Numeric runs dominate the data, where Set C halves the symbol width.
- The label is expected to migrate to GS1-128 Application Identifier syntax later.
Choose Code 39
- A published specification such as MIL-STD-129 or an AIAG label standard names it explicitly.
- Installed readers or printers predate Code 128 support.
- Per-character self-checking is required without adding a check digit to the data field.
Recommendation
For new alphanumeric labelling Code 128 is the default, since it covers the full ASCII range and produces a materially narrower symbol, most dramatically for numeric data. Code 39 is worth retaining only where a published standard names it or where installed hardware constrains the decision.