Code 128 vs. Code 39: Density, Character Sets & Industrial Standards
An engineering comparison of the two most prevalent 1D industrial barcode symbologies: explore how Code 128 achieves superior data density over Code 39, the mechanics of Code Set C numeric compaction, and how to choose the right standard.
Overview of Industrial 1D Symbologies
Unlike retail items that use fixed-length numeric EAN or UPC codes, industrial warehousing, logistics shipping labels, asset tracking tags, and defense equipment require variable-length alphanumeric barcodes.
For decades, the two primary options have been Code 39 and Code 128. While both encode text and numbers, their internal architectures deliver radically different space efficiencies and reliability.
1. Code 39: The Legacy Pioneer (1974)
Invented by Dr. David Allais and Ray Stevens at Intermec in 1974, Code 39 was named because each character consists of 9 elements (5 bars and 4 spaces), of which 3 are always wide (hence “3 of 9”).
- Character Set: 43 characters total: uppercase letters (A–Z), numbers (0–9), and seven symbols (
- . $ / + % space). - Discrete Construction: Each character is bounded by an unencoded inter-character space gap.
- Check Digit: Optional Modulo-43.
- Primary Limitation: Extremely wide physical footprint. Encoding long serial numbers often produces barcodes too long for standard label rolls.
2. Code 128: The Modern High-Density Standard (1981)
Invented by Ted Williams at Computer Identics in 1981, Code 128 was engineered to solve the size limitations of Code 39 and provide support for the entire ASCII character set.
- Full ASCII Encoding: Encodes all 128 ASCII characters (including lowercase letters, punctuation, and non-printable control characters).
- Three Dynamic Code Sets:
- Set A: Uppercase letters, digits, and control characters (NUL, CR, LF).
- Set B: Uppercase and lowercase letters, digits, and punctuation.
- Set C: Compresses numeric data by pairing two digits into a single symbol module (00–99), cutting label width in half!
- Mandatory Checksum: Requires an internal Modulo-103 check character computed across all data bytes, ensuring near-zero false read rates.
Technical Specification Matrix
| Specification | Code 128 | Code 39 |
|---|---|---|
| Character Capacity | 128 ASCII characters | 43 characters (uppercase only) |
| Relative Width (Density) | High density (30%–50% narrower) | Low density (very wide) |
| Mandatory Checksum | Yes (Modulo-103) | Optional (Modulo-43) |
| Numeric Compaction | Yes (Code Set C pairs digits) | No |
| Primary Modern Usage | GS1-128 shipping labels, logistics, SKUs | Military (MIL-STD-129), legacy government |
Decision Framework: Which Should You Use?
Default to Code 128: Unless you have an explicit contractual or hardware constraint forcing Code 39, always choose Code 128. It produces cleaner, narrower barcodes, supports lowercase letters, and eliminates false reads via its mandatory Modulo-103 check character.
Use Code 39 only when: You are interfacing with legacy 1980s/1990s fixed-mount industrial barcode readers that lack Code 128 firmware, or submitting packaging under older US Department of Defense contracts requiring MIL-STD-129.
Frequently Asked Questions
Code 128 uses a continuous symbology where inter-character spaces encode data, unlike Code 39 which uses discrete characters separated by dead margins. Furthermore, Code 128 includes 'Code Set C', which encodes two numeric digits into a single barcode character, halving the symbol width for pure numbers.
Choose Code 39 only when required by legacy hardware that cannot decode Code 128, or when mandated by specific military or industrial specifications like the US Department of Defense MIL-STD-129/130 or automotive AIAG standards.
In its original 1974 specification, Code 39 relies on optical self-checking bars and does not require a mathematical check digit. An optional Modulo-43 check digit exists, whereas Code 128 mandates a powerful Modulo-103 check character in every valid symbol.
Try the Tools Mentioned in this Guide
Code 128 Barcode Generator →
Generate compact, high-density industrial and shipping barcodes in SVG and PNG.
Code 39 Barcode Generator →
Create standard 43-character alphanumeric barcodes for defense and legacy systems.
Universal Barcode Scanner →
Read Code 128 and Code 39 barcodes instantly using your device camera or image file.