Code 128 vs Code 39: Which Barcode Standard is Right for Your Business?
Ready to generate barcodes?
Create high-quality labels in seconds.
When implementing a barcode system for your warehouse or logistics chain, one of the first decisions you'll face is choosing between Code 128 and Code 39. While both are alphanumeric, they serve very different purposes.
In the world of physical tracking, industrial logistics, and manufacturing, linear (1D) barcodes remain the bedrock of operations. Unlike 2D codes (like QR Codes or DataMatrix) which require digital camera-based image scanners, linear barcodes can be read by simple, inexpensive laser scanners.
If you are setting up an internal asset tracking system, labeling storage bins, or organizing warehouse shelves, the choice almost always comes down to two major industrial standards: Code 39 and Code 128. Making the wrong choice can lead to oversized labels, scan failures, and system integration headaches.
Here is the definitive guide to understanding their engineering differences and choosing the correct standard for your business.
1. What is Code 39 (The Legacy Pioneer)?
Introduced in 1974 by Intermec, Code 39 (also known as "Code 3 of 9") was the first alphanumeric barcode ever developed. Its name refers to its physical structure: each character is represented by nine bars and spaces, and exactly three of those elements are wide (thick), while the other six are narrow.
Character Set and Constraints
By default, Code 39 is self-checking and supports 43 unique characters:
- All uppercase letters (
AthroughZ). - Numbers (
0through9). - A handful of symbols: space,
-,.,$,/,+,%. - The asterisk (
*) is reserved exclusively as the start and stop character. Scanners do not transmit the asterisks; they simply use them to know where the barcode starts and ends.
Note: There is an extended version called "Full ASCII Code 39" which can encode lowercase letters and all 128 ASCII characters, but it does so by pairing two standard characters together (e.g., encoding a lowercase "a" requires printing "+A"). This doubles the width of the barcode, making it highly inefficient.
Key Characteristics of Code 39
- Low Density: Because each character requires 9 wide and narrow elements, the physical length of the barcode grows rapidly with every added character. If you need to encode a 15-character serial number, a Code 39 barcode can easily exceed 4 or 5 inches in width.
- No Mandatory Checksum: Standard Code 39 does not require a checksum digit. The self-checking design of the character blocks means that the chance of a misread is low, though still higher than modern standards. An optional Modulo 43 check digit can be added for enhanced safety.
- Simple Decoding: Because of its simple thick-and-thin structure, almost any scanner on the planet—even decades-old legacy lasers—can decode Code 39 instantly without advanced software.
2. What is Code 128 (The Modern Workhorse)?
Developed in 1981 by Computer Identics, Code 128 is a modern, high-density linear barcode. It was engineered specifically to solve the physical size limitations of Code 39 while adding robust error checking and full keyboard encoding.
Full ASCII Support and Subsets
Unlike Code 39, Code 128 can encode all 128 characters of the standard ASCII table—including lowercase letters, punctuation marks, control codes (like carriage returns), and system commands.
To achieve this versatility without bloating the barcode size, Code 128 uses three distinct character subsets (A, B, and C) and can dynamically switch between them in the middle of a single barcode:
- Code 128A: Contains numeric, uppercase letters, and control characters (like tab or backspace).
- Code 128B: Contains numeric, uppercase, and lowercase alphabetical characters, along with standard punctuation.
- Code 128C (Double-Density Compression): This is a stroke of engineering genius. Subset C is reserved strictly for numeric pairs. Instead of encoding one number per symbol, it compiles two digits into a single barcode pattern. If you are encoding a serial number made entirely of digits (e.g.,
20260525), Code 128C will compress it into 4 data characters instead of 8, making it incredibly short.
Key Characteristics of Code 128
- High Density: Because it uses four different bar and space widths (rather than just two), Code 128 can pack significantly more data into a much smaller footprint. A Code 128 barcode is typically 30% to 50% narrower than an equivalent Code 39 barcode containing the same text.
- Mandatory Checksum: Code 128 features a built-in, mandatory checksum digit calculated using a weighted Modulo 103 algorithm. The check digit is calculated automatically by the generator and appended to the end of the code. This ensures a practically non-existent substitution error rate (less than one in several million scans).
- Global Logistics Standard: Code 128 is so reliable that it forms the foundation of the global GS1-128 shipping standard (formerly UCC/EAN-128), used to label millions of commercial transport cartons worldwide.
3. Side-by-Side Comparison
| Feature | Code 39 | Code 128 |
|---|---|---|
| Year Introduced | 1974 | 1981 |
| Density & Size | Low (Very long for >8 characters) | High (Compact, especially for numbers) |
| Character Set | Uppercase only, numbers, 7 symbols | Full 128 ASCII (including lowercase) |
| Numeric Compression | None | Yes (2 digits per symbol in Subset C) |
| Self-Checking | Yes | Yes |
| Check Digit | Optional (Modulo 43) | Mandatory (Modulo 103, highly secure) |
| Primary Industry Use | US Defense (MIL-STD), Automotive (AIAG), Electronics | Global Logistics (GS1), Warehousing, Retail Shipping |
| Relative Scan Error Rate | Higher (Falsely scans partial cuts) | Extremely Low (virtually zero misreads) |
4. How to Choose the Right Standard for Your Business
To determine which linear standard to implement, ask yourself the following architectural and hardware questions:
When to Choose Code 39
- Legacy Scanners: If you are integrating with vintage inventory systems, industrial machinery, or older laser wands that lack modern decoding firmware, Code 39 is safe because of its extreme decoding simplicity.
- Short, Alphabetic Codes: If your data strings are extremely short (e.g., a bin number like
BIN-A1or a room codeRM-102), the length of Code 39 remains manageable, and you don’t need to worry about complex checksum logic. - Simple Printer Drivers: If you are printing barcodes using raw text fonts in basic software (where the software simply wraps asterisks around a string, like
*BIN101*), Code 39 is easy to implement without database plugins.
When to Choose Code 128 (Recommended for Modern Systems)
- Space is Restricted: If you are labeling small items, vials, assets, or standard office documents, Code 128 is the superior choice. Its compact layout saves label material and prints easily on small thermal printers.
- Long Data and Numeric Serial Numbers: If your barcodes contain serial numbers, shipping numbers, or tracking codes exceeding 8 characters, Code 128’s numeric compression (Subset C) keeps your labels narrow and scannable.
- Lowercase and Punctuation Needed: If your internal system requires case-sensitive passwords, email addresses, or special delimiters, Code 128 is the only linear option that supports them natively.
- Maximum Security Against Misreads: In medical tracking, pharmaceutical inventory, and high-value logistics, a misread barcode can have catastrophic consequences. Code 128’s Modulo 103 checksum provides absolute security against scan errors.
Conclusion
While Code 39 is a rugged, simple pioneer that still holds its ground in legacy military and industrial circles, Code 128 is the modern industry standard for general logistics, commercial retail shipping, and business inventory. Its high density, full ASCII character set, and mandatory checksum make it the most efficient and secure 1D barcode available.
Whichever standard you choose, ensure your design prints crisply and scans flawlessly. Use BarcodeReady to generate professional, standards-compliant Code 128 or Code 39 barcodes in high-resolution vector SVG or PDF formats!