Understanding the Key Differences Between Two Popular Barcode Standards
When it comes to choosing the right barcode symbology for your business, understanding the differences between Code 128 and Code 39 is essential. Both are widely used linear (1D) barcodes, but each has unique characteristics that make them suitable for different applications. In this comprehensive guide, we’ll explore the key differences, advantages, and use cases for both barcode types to help you make an informed decision.
What is Code 39?
Code 39, also known as Code 3 of 9 or Alpha39, is one of the oldest barcode standards still in use today. Developed in 1974 by Dr. David Allais and Raymond Stevens at Interface Mechanisms Inc., Code 39 has stood the test of time due to its simplicity and versatility.
Key Features of Code 39
Character Support: Code 39 can encode 43 different characters, including:
- Uppercase letters (A-Z)
- Numeric digits (0-9)
- Special characters: dash (-), period (.), dollar sign ($), slash (/), plus (+), percent (%), and space
Structure: Each character in Code 39 is represented by nine elements—five bars and four spaces—with three of these elements being wide. This “3 of 9” pattern is where the barcode gets its name.
Variable Length: Code 39 barcodes can vary in length depending on the amount of data being encoded, though they are limited to 43 characters maximum.
Self-Checking: Code 39 is a self-checking symbology, meaning it doesn’t require a separate checksum for basic operation. However, an optional checksum can be added for enhanced error detection in critical applications.
What is Code 128?
Code 128 is a high-density barcode symbology introduced in 1981 by Ted Williams of Laserlight Corporation. It was specifically designed to overcome the limitations of Code 39 by providing better data density without sacrificing the ability to encode both alphabetic and numeric characters.
Key Features of Code 128
Character Support: Code 128 can encode the full 128-character ASCII set, including:
- Uppercase and lowercase letters (A-Z, a-z)
- Numeric digits (0-9)
- Special symbols and punctuation marks
- Control characters (such as tab and enter)
High Density: Code 128 uses a more compact encoding method, allowing more data to be stored in less space compared to Code 39.
No Character Limit: Unlike Code 39’s 43-character limitation, Code 128 has no maximum character limit, making it extremely flexible for various applications.
Mandatory Checksum: Code 128 includes a built-in check digit that is automatically calculated and verified during scanning, providing superior error detection capabilities.
Major Differences Between Code 128 and Code 39
1. Data Density and Size Efficiency
One of the most significant differences between these two barcode types is their data density—how much information can be stored in a given physical space.
Code 39: Due to its structure where each character requires nine elements (five bars and four spaces), Code 39 produces larger barcodes. This lower data density means that Code 39 barcodes take up more physical space on labels, making them less ideal for small items or space-constrained applications.
Code 128: With its high-density design, Code 128 can store the same information in approximately 30-40% less space than Code 39. This makes Code 128 the preferred choice when label space is limited or when you need to maximize the amount of data on a small label.
For example, encoding the same numeric sequence will result in a noticeably shorter barcode with Code 128 compared to Code 39, making it ideal for small product labels, electronics, and medical supplies.
2. Character Set and Encoding Capability
Code 39: Can encode only 43 characters in its standard form. While there is an Extended Code 39 version that can represent the full ASCII 128 character set, it does so by using combinations of standard Code 39 characters, which results in even longer barcodes—defeating some of its practical advantages.
Code 128: Natively supports the complete 128 ASCII character set, including uppercase letters, lowercase letters, numbers, special characters, and control codes. This native support means you can encode complex data strings without increasing barcode length unnecessarily.
This difference is critical when you need to encode:
- Mixed case text (product descriptions, serial numbers)
- Special characters (batch codes, chemical formulas)
- Complex alphanumeric sequences (tracking numbers, patient identifiers)
3. Error Detection and Data Integrity
Code 39: Does not include error correction features by default. While you can optionally add a checksum for error detection, it’s not mandatory. If a Code 39 barcode is damaged, obstructed, or poorly printed, it typically cannot be scanned at all.
Code 128: Includes a mandatory check digit that is automatically calculated during barcode generation and verified during scanning. This built-in error detection significantly improves data accuracy and allows Code 128 barcodes to remain scannable even if slightly damaged or degraded.
For businesses where accuracy is critical—such as healthcare, pharmaceuticals, or logistics—Code 128’s superior error detection is a major advantage.
4. Print Quality Requirements
Code 39: Uses only two different bar widths (wide and narrow), making it more tolerant of poor print quality and variations in printing conditions. This simplicity means Code 39 can be reliably printed on uneven surfaces, corrugated cardboard, or with basic printing equipment.
Code 128: Uses four different bar widths, which places higher demands on print quality and consistency. While modern printing technology handles this well, Code 128 may be less reliable when printed on rough surfaces or with lower-quality printing equipment.
5. Scanner Compatibility
Code 39: Due to its simpler structure and longer history, Code 39 is compatible with virtually all barcode scanners, including older and basic models. The two-width bar system (wide and narrow) is easier for scanners to distinguish, especially in poor lighting or at various angles.
Code 128: While most modern barcode scanners can read Code 128 without issues, some older or basic scanning equipment may have difficulty due to the four different bar widths requiring more precise optical recognition.
When to Use Code 39
Code 39 remains the ideal choice in several scenarios:
1. Non-Critical Applications with Simple Data
When you’re encoding short, straightforward information such as:
- Basic inventory tracking
- Equipment identification numbers
- Warehouse bin locations
- Tool and asset tracking
2. Space is Not a Constraint
If you have plenty of label real estate and don’t need to minimize barcode size, Code 39’s simplicity and reliability make it an excellent choice. This includes:
- Large shipping containers
- Equipment with ample labeling space
- Warehouse shelving and location markers
3. Legacy System Compatibility
Organizations with older scanning equipment or established systems built around Code 39 may prefer to continue using this standard rather than upgrading their entire infrastructure.
4. Challenging Printing Conditions
When printing on uneven surfaces, corrugated materials, or with basic printing equipment, Code 39’s simpler structure and two-width bar system provide better reliability.
Common Code 39 Applications:
- Automotive industry parts tracking
- U.S. Department of Defense asset labeling
- Library book identification (internal systems)
- Retail inventory management (non-point-of-sale)
- Manufacturing floor tracking
When to Use Code 128
Code 128 is the superior choice when:
1. Space is Limited
For small products, compact labels, or applications where maximizing label space is important:
- Small electronics and components
- Medical devices and pharmaceutical packaging
- Cosmetics and personal care products
- Jewelry and small retail items
2. Complex Data Requirements
When you need to encode:
- Full alphanumeric data with mixed case
- Special characters and symbols
- Long serial numbers or tracking codes
- Batch numbers with expiration dates
3. High Data Accuracy is Critical
Industries where scanning errors could have serious consequences:
- Healthcare (patient identification, medication tracking)
- Pharmaceuticals (drug batch tracking, regulatory compliance)
- Food safety (traceability and recall management)
- Aviation and aerospace (component tracking)
4. Shipping and Logistics
Code 128’s compact size and high data capacity make it ideal for:
- Shipping labels with tracking numbers
- Package identification
- Supply chain management
- International shipping documentation
Common Code 128 Applications:
- GS1-128 (formerly UCC/EAN-128) for supply chain applications
- Retail point-of-sale inventory tracking
- Healthcare patient wristbands and medication labels
- Courier and postal services (tracking numbers)
- Manufacturing and product serialization
Extended Code 39: Bridging the Gap
It’s worth noting that Extended Code 39 exists as a variant that can theoretically encode the full ASCII 128 character set. However, it achieves this by using combinations of standard Code 39 characters, which:
- Significantly increases barcode length
- Reduces scanning reliability
- Negates many advantages of using Code 39 in the first place
For applications requiring full ASCII support, Code 128 is almost always the better choice rather than using Extended Code 39.
Similarities Between Code 128 and Code 39
Despite their differences, both barcode types share some common characteristics:
- Linear Barcodes: Both are one-dimensional (1D) barcodes that are scanned horizontally
- Variable Length: Both can accommodate varying amounts of data
- Widely Supported: Most modern barcode scanners can read both types
- Non-Retail: Neither should be used for retail point-of-sale applications (which require EAN or UPC barcodes)
- Alphanumeric Support: Both can encode letters and numbers (though with different capabilities)
Making Your Decision
When choosing between Code 128 and Code 39, consider these key questions:
1. How much data do you need to encode?
- Short, simple codes → Code 39 works fine
- Complex, lengthy data → Code 128 is better
2. How much space do you have?
- Ample label space → Code 39 is sufficient
- Limited space → Code 128 is necessary
3. What character types do you need?
- Uppercase letters and numbers only → Code 39 is adequate
- Mixed case, special characters → Code 128 is required
4. How critical is data accuracy?
- Basic tracking → Code 39 is acceptable
- Critical applications (healthcare, pharmaceuticals) → Code 128 is essential
5. What are your printing conditions?
- Challenging surfaces or basic printers → Code 39 is more reliable
- High-quality printing equipment → Code 128 works excellently
6. What scanning equipment do you use?
- Older, basic scanners → Code 39 is safer
- Modern scanning equipment → Either will work fine
Future Considerations
While both Code 128 and Code 39 remain widely used and will continue to be for years to come, it’s worth noting that the industry is gradually moving toward 2D barcodes (such as QR codes and Data Matrix codes) for applications requiring even more data density and functionality.
However, for most industrial, logistics, healthcare, and inventory management applications, Code 128 and Code 39 will remain relevant and cost-effective solutions for the foreseeable future.
Conclusion
Both Code 128 and Code 39 have their place in modern barcode applications. Code 39 excels in simplicity, compatibility with older systems, and reliability in challenging printing conditions. Code 128 offers superior data density, full ASCII support, better error detection, and is the preferred choice for space-constrained applications and situations where data accuracy is paramount.
The key to choosing the right barcode for your needs lies in understanding your specific requirements—consider your data complexity, available space, scanning equipment, printing conditions, and accuracy requirements. By carefully evaluating these factors, you can select the barcode symbology that best serves your business needs.
For most modern applications, especially those in logistics, healthcare, retail inventory, and manufacturing, Code 128 is generally the recommended choice due to its compact size and robust error detection. However, for simple asset tracking, equipment labeling, and applications with legacy system requirements, Code 39 remains a reliable and effective solution.
Looking to implement barcode labeling solutions for your business? Understanding these fundamental differences between Code 128 and Code 39 is the first step toward creating an efficient, accurate, and cost-effective barcode system that meets your unique operational needs.
