Chapter 19: The Minimum Length Problem |
In Brief |
Code 39 is a marvel of practical engineering---a barcode symbology that, for the first time in history, allowed the encoding of both letters and numbers in a single, scannable pattern. Yet hidden within its elegant design is a peculiar inefficiency that surfaces most vividly when the data to be encoded is at its shortest. Even a single digit, such as the number 5, demands three asterisks, plus one data character, plus the necessary intercharacter gaps---representing the equivalent of four characters' worth of bars and spaces. This makes short codes surprisingly long in physical form. The Minimum Length Problem is not a flaw in the traditional sense, but rather a fascinating consequence of Code 39's architecture, one that ripples through every industry that relies upon it. This chapter explores the origins of this problem, its technical underpinnings, and how the automotive, defense, healthcare, and logistics sectors have learned to live with---and even benefit from---this unique characteristic. |

|
The Architecture of an Icon |
To understand why a single digit becomes so lengthy when rendered in Code 39, we must first appreciate the symbology's foundational design. Code 39, also known as Code 3 of 9, was developed by Dr. David Allais and Ray Stevens of Intermec in 1974. It was the first barcode symbology capable of encoding the full alphanumeric character set---the 26 uppercase letters A through Z, the digits 0 through 9, and a handful of special characters. This was a revolutionary step forward at a time when most barcodes could only represent numbers. |
The name 'Code 3 of 9' derives from the symbology's most distinctive structural feature: every character in the Code 39 set is composed of nine elements---five bars and four spaces---and exactly three of these nine elements are wide. The remaining six elements are narrow. This consistent pattern of three wide elements out of nine is the genetic code of Code 39; it is what makes the symbology both robust and, in certain circumstances, inefficient. |
The wide-to-narrow ratio can vary between 2:1 and 3:1, offering some flexibility in printing and scanning. However, the fundamental arithmetic remains unchanged: each character you wish to encode requires nine individual units of width, plus an additional intercharacter gap that separates each character from its neighbor. This gap is typically the width of a single narrow element. These intercharacter gaps are what make Code 39 a 'discrete' barcode---each character stands distinctly apart from the next, unlike continuous symbologies where characters flow into one another. |

|
The Minimum Length Problem Defined |
Now we arrive at the heart of the matter: the Minimum Length Problem. Code 39 does not simply encode the characters you want to represent. It wraps them in a necessary framework. Every Code 39 barcode must begin with a start character and end with a stop character. By convention, the asterisk (*) serves as both the start and stop delimiter. These asterisks are not data; they tell the scanner where the barcode begins and ends. They are the silent sentinels of the Code 39 world, present in every single label, yet never part of the information being conveyed. |
Consider what this means for encoding a single digit. Suppose you wish to encode the number 5. The data character '5' must be encoded, of course. But before the scanner can read that '5,' it must first see the start asterisk. After the '5,' it must see the stop asterisk. This gives us the sequence: * 5 *. |
Each character---each asterisk and each digit---is a pattern of nine elements (five bars, four spaces). Three of those nine elements are wide. So each character has a fixed 'cost' in terms of physical space. For the three characters required to represent a single digit, we are already at three characters' worth of physical width. To this, we must add the intercharacter gaps that separate the start character from the data character and the data character from the stop character. These gaps add the equivalent of roughly one more narrow element's width each. In practical terms, encoding a single digit in Code 39 consumes the physical space equivalent of approximately four full characters. |
This is the Minimum Length Problem in a nutshell: the overhead of the start and stop characters means that short codes are disproportionately long. A barcode representing a single digit is not one character long; it is, for all practical purposes, at least three characters long, and with the intercharacter gaps, it behaves like four. It is a classic case of fixed overhead consuming a large percentage of a small payload. |

|
The Industry Implications |
This architectural quirk is not merely an academic curiosity. It has profound implications across the many industries that rely on Code 39. The symbology's popularity in sectors like automotive, defense, and healthcare is well-documented, and in each of these fields, the Minimum Length Problem influences design choices, scanner configurations, and even the structure of the data being encoded. |
Automotive Manufacturing: The Part Number Puzzle |
In the automotive industry, Code 39 barcodes are used extensively for parts identification and tracking. Every component, from a simple bolt to a complex engine module, often carries a Code 39 label. Here, the Minimum Length Problem manifests in an interesting way. Many automotive parts are identified by short alphanumeric codes---sometimes just a few characters indicating a part family, a revision level, or a specific variant. |
Consider a part identifier like 'A7.' In the context of a manufacturing line, this might be sufficient to route a component to the correct assembly station. But in Code 39, 'A7' becomes *A7*, a pattern that consumes space far beyond its two-character data payload. The start and stop asterisks, plus the intercharacter gaps, create a label that is significantly wider than the data itself might suggest. |
Automotive manufacturers have learned to accommodate this. They design their labels with generous dimensions, understanding that a short part number will still require a reasonably large barcode. This is not a problem in contexts where parts are large or labels can be printed with ample whitespace. However, it becomes a constraint when the physical dimensions of the part itself are small. A tiny electronic sensor or a miniature fastener may not have a surface large enough to accommodate a Code 39 label that can be reliably scanned. In these cases, manufacturers are forced to consider alternative symbologies with higher density, such as Code 128, or to redesign their part numbering schemes to use longer codes that make the fixed overhead less noticeable. |

|
Defense and LOGMARS: The Standard Bearer |
The United States Department of Defense has long been a major proponent of Code 39. The LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) system, adopted by the DoD, standardized on Code 39 for tracking supplies and equipment. In this context, the Minimum Length Problem intersects with the stringent requirements of military logistics. |
Military supply chains often involve items that must be tracked from origin to deployment. These items are assigned National Stock Numbers (NSNs) or other identifiers that are of moderate length. The use of Code 39 means that even short identifiers carry the overhead of the start and stop characters. For the DoD, this is an acceptable trade-off. The reliability and self-checking nature of Code 39 are paramount. The symbology's design ensures that a single print defect or scanning error is unlikely to produce a valid but incorrect character, a feature that is critical when lives and equipment are at stake. |
However, the Minimum Length Problem does create practical challenges. Military labels often need to be read in challenging conditions---in rain, mud, or low light, by soldiers who may not have time to carefully align a scanner. A longer barcode, even if most of its length is overhead, is more susceptible to being partially obscured or damaged. The fixed overhead of the start and stop asterisks means that even a short code produces a label that is long enough to risk being cropped by label damage. This has led to careful specifications regarding label placement and protection, ensuring that the entire Code 39 symbol, overhead and all, remains scannable. |

|
Healthcare: The Patient Wristband Conundrum |
In healthcare, Code 39 is widely used, particularly in applications governed by standards such as those from HIBCC (Health Industry Business Communications Council). Patient identification wristbands are a classic example. These wristbands typically encode a patient identifier---often a short alphanumeric string that uniquely identifies the patient within a hospital's system. |
The Minimum Length Problem is acutely felt here. A patient identifier like 'P789' becomes *P789* in Code 39. The start and stop asterisks, together with the intercharacter gaps, make the barcode longer than the data itself would suggest. On a patient wristband, where space is at a premium, this can be a serious constraint. Wristbands are small; they must be comfortable to wear and must not be so large that they interfere with medical procedures. Printing a Code 39 barcode on a wristband means allocating a significant portion of the wristband's surface area to the barcode, leaving less room for human-readable text or other information. |
Hospitals have developed workarounds. Many use specialized wristband printers that can print high-density Code 39 labels with very small narrow bar widths, allowing the barcode to be compressed into a smaller physical space. Others have adopted Code 128, which offers higher density and can encode more information in a smaller area. Yet Code 39 persists, particularly in older systems and in applications where the simplicity of the symbology---notably, the lack of a mandatory check digit---makes it easier to integrate with existing software. The Minimum Length Problem, while recognized, is often managed by careful printer calibration and scanner configuration. |

|
Logistics and Warehousing: The Inventory Conundrum |
In the logistics and warehousing sector, Code 39 is used for asset tracking and inventory management. Warehouses are filled with pallets, bins, and individual items, each bearing a barcode that helps workers locate, pick, and ship goods. Here, the Minimum Length Problem manifests in the context of warehouse efficiency. |
Consider a bin location code like 'B12.' In Code 39, this short code becomes *B12*. The barcode is longer than the data it represents. In a busy warehouse, where workers scan hundreds or thousands of codes per shift, the physical length of the barcode influences how easily it can be placed on bins and how quickly it can be scanned. A longer barcode requires a larger label, which may not fit on every bin or shelf. It also requires the scanner to have a sufficiently wide scan beam to read the entire code, potentially slowing down the scanning process. |
Warehouse managers have responded by optimizing their labeling strategies. Where possible, they use Code 39 for larger items and locations where label space is abundant. For smaller items or for applications where data density is a priority, they may switch to Code 128. Additionally, many modern warehouse management systems are configured to handle the Minimum Length Problem by using scanner settings that specify a minimum and maximum length for barcodes, ensuring that only valid codes are read and that short codes are not misinterpreted. These settings help mitigate the risk of a scanner reading a partial barcode---perhaps one where the stop character has been obscured---and producing an erroneous result. |

|
Electronics Industry: The Component Label Challenge |
The electronics industry presents perhaps the most stringent test of Code 39's resilience against the Minimum Length Problem. Electronic components are famously small---resistors, capacitors, and microchips often measure mere millimeters across. These tiny components require identification and tracking for quality control and supply chain management. |
Printing a Code 39 barcode on a component that is barely larger than a grain of rice is a daunting task. The Minimum Length Problem makes it harder, because even a short component code requires multiple characters of physical width. The start and stop asterisks, plus the data character, cannot be compressed beyond a certain point without making the bars too thin to be reliably printed or scanned. The wide-to-narrow ratio of Code 39 imposes a minimum bar width; if the narrow bars become too thin, they may not print clearly, or they may be damaged by handling. |
As a result, the electronics industry has largely moved away from Code 39 for direct component marking, favoring smaller 2D codes such as Data Matrix or QR codes, which can encode significant amounts of data in a tiny area. However, Code 39 still finds use on larger components, on packaging, and in the supply chain where labels can be printed on larger surfaces. For these applications, the Minimum Length Problem is a known constraint, and engineers design their labeling and scanning systems to accommodate the physical space requirements. |

|
Postal and Shipping: The Tracking Number Overhead |
Postal and shipping services have historically used Code 39 for tracking packages. Tracking numbers are often long alphanumeric strings, which helps mitigate the Minimum Length Problem because the fixed overhead of the start and stop asterisks is amortized over a larger number of data characters. When you encode a 20-character tracking number, the start and stop asterisks represent a much smaller fraction of the total barcode length than they do when you encode a single digit. |
Nevertheless, the Minimum Length Problem can surface in postal applications when short codes are used. Some shipping labels include a short code indicating the service type, or a destination area code. These short codes, when encoded in Code 39, become longer than their data content would suggest. On a shipping label, where space is often at a premium due to the need to include address information, other barcodes, and human-readable text, this can be a challenge. |
Postal services have adapted by carefully designing their label layouts. They may use different barcode symbologies for different types of information, reserving Code 39 for fields where its alphanumeric capability and self-checking nature are most valuable, and using higher-density symbologies for other fields. The Minimum Length Problem is one of several factors that influence these design decisions. |

|
Technical Responses to the Minimum Length Problem |
The Minimum Length Problem has not gone unaddressed by the technical community. Several responses have emerged, ranging from scanner configuration to the development of extended symbologies. |
Scanner Configuration and Length Qualification |
One of the most common responses is to configure barcode scanners with length qualification settings. Many scanners allow administrators to set a minimum and maximum length for acceptable barcodes. By specifying a minimum length, the scanner will ignore any barcode that is shorter than that threshold. This prevents the scanner from misreading a partial barcode or from interpreting a short code that might have been truncated due to damage. |
For example, if an application uses only codes that are at least 5 characters long, setting the minimum length to 5 ensures that the scanner will not accidentally read a 3-character code that might be a fragment of a larger code. This is particularly important in environments where multiple barcode types are used and where there is a risk of confusion. |
Some scanners allow for the configuration of one, two, or three fixed lengths. This provides even more control, as it allows the scanner to recognize only codes that have specific, predetermined lengths. If an application always uses a fixed-length identifier, this setting can dramatically improve scanning performance and security. |

|
Code 39 Extended: A Double-Edged Sword |
Code 39 Extended, also known as Full ASCII Code 39, was developed to overcome the limitation of standard Code 39, which cannot directly encode lowercase letters or all ASCII characters. Code 39 Extended uses a clever trick: it encodes lowercase letters and additional symbols by using two-character combinations. For example, the lowercase letter 'a' is encoded as '+A'. |
This extension solves one problem but exacerbates another. By using two characters to represent a single data character, Code 39 Extended effectively doubles the length of the barcode for those characters. For short codes, this is catastrophic. Encoding a single lowercase letter 'a' in Code 39 Extended requires the start asterisk, then '+A' (two characters), then the stop asterisk---a total of five characters of overhead, plus intercharacter gaps. The Minimum Length Problem becomes the Minimum Length Catastrophe. |
For this reason, Code 39 Extended is used sparingly, primarily in applications where full ASCII support is essential and where the physical space on the label is not a constraint. In most cases, users who need to encode lowercase letters or a wide range of symbols are better served by Code 128, which provides higher density and direct support for the full ASCII character set without the double-character expansion. |

|
The Self-Checking Advantage |
Despite the Minimum Length Problem, Code 39 enjoys a significant advantage in many applications: it is self-checking. This means that a single erroneous bar---a narrow bar that is printed wide, or a wide bar that is printed narrow---is unlikely to transform one valid Code 39 character into another valid Code 39 character. The architecture of the symbology, with its strict pattern of three wide elements out of nine, ensures that most printing defects are detected by the scanner. |
This self-checking feature is critical in environments where print quality may be variable, such as in industrial manufacturing or field logistics. It provides a level of robustness that compensates, at least in part, for the low data density and the Minimum Length Problem. The confidence that a scanner will either read the correct code or fail to read the code at all, rather than misreading it, is worth the extra physical length in many applications. |
The lack of a mandatory check digit further simplifies Code 39 implementation. Unlike Code 128, which requires a check digit to ensure data integrity, Code 39 can be printed and scanned without any additional computation. This makes it easy to integrate into existing systems by simply adding a barcode font to a printer. The ease of implementation has been a major factor in Code 39's longevity, even as its limitations have become more apparent. |

|
Comparative Perspective: Code 39 Versus Other Symbologies |
To fully appreciate the Minimum Length Problem, it is useful to compare Code 39 with other barcode symbologies. Code 128, for example, is widely regarded as a superior symbology in terms of data density. It encodes more characters in a given physical space, making it more suitable for applications where label space is limited. However, Code 128 requires a check digit, which adds a layer of complexity to implementation. It is also a continuous symbology, meaning that characters are not separated by intercharacter gaps, which can make it slightly more sensitive to certain printing defects. |
Interleaved 2 of 5 is another symbology that offers higher density than Code 39, but it is limited to numeric data. For applications that require letters, Code 39 remains a viable choice. |
PDF417 and Data Matrix are 2D symbologies that can encode vast amounts of data in a small area, but they require more sophisticated scanners and are not as universally compatible as 1D symbologies. In many industrial and logistics applications, the installed base of scanners is optimized for 1D barcodes, making Code 39 an attractive option despite its inefficiencies. |
The Minimum Length Problem is a feature of Code 39's design, not a bug. It is a trade-off that the original developers of Code 39 made in 1974: in exchange for the ability to encode letters and numbers with a simple, self-checking pattern, they accepted that the symbology would be less efficient in terms of space. For many applications, this trade-off was and remains acceptable. |

|
Real-World Workarounds and Best Practices |
Industries that rely on Code 39 have developed a set of best practices to manage the Minimum Length Problem. These include: |
Label Design: Designing labels with sufficient space for the Code 39 barcode, including the start and stop asterisks. This often means using larger labels than might be strictly necessary for the data content. |
Printer Calibration: Using printers that can produce very narrow bar widths, allowing the barcode to be compressed into a smaller physical space. The narrow bar width can be as small as 0.0075 inches, depending on the printer's capabilities. |
Scanner Configuration: Configuring scanners with appropriate length qualification settings to prevent misreads. This includes setting minimum and maximum length parameters, and, where possible, specifying fixed lengths for the codes in use. |
Data Design: Designing part numbers or identifiers to be longer, so that the fixed overhead of the start and stop asterisks is amortized over a larger number of data characters. This is not always possible, but where it is, it can significantly reduce the relative impact of the overhead. |
Alternative Symbologies: Switching to Code 128 or other higher-density symbologies for applications where the Minimum Length Problem is particularly acute. This is a pragmatic approach that recognizes the strengths and weaknesses of each symbology. |

|
The Enduring Legacy |
The Minimum Length Problem is a fascinating lens through which to view the history and practice of barcode technology. It reveals the fundamental engineering choices that shaped Code 39 and the practical realities that have kept it in use for half a century. |
Code 39 is a symbology of compromises. It trades data density for simplicity, and simplicity for reliability. The fixed overhead of the start and stop asterisks is a direct consequence of its design as a discrete, self-checking symbology. It is not a flaw; it is a feature. It is the price paid for the ability to encode letters and numbers in a pattern that can be read with almost any scanner, without the need for complex checksum calculations. |
The Minimum Length Problem ensures that even the shortest data is represented by a barcode of non-trivial length. This is a reminder that in the world of barcodes, as in so many other areas of engineering, there is no perfect solution, only trade-offs. The genius of Code 39 lies not in its perfection, but in its ability to balance these trade-offs in a way that has proven remarkably durable. |

|
Summary: The Minimum Length Problem in Context |
The Minimum Length Problem is a defining characteristic of Code 39 barcodes. It stems from the symbology's requirement for start and stop asterisks, the intercharacter gaps that separate each character, and the fixed pattern of nine elements per character, three of which are wide. These architectural features mean that even a single digit, such as '5', requires the physical space equivalent of approximately four characters. This is not a bug, but a design trade-off that has been accepted across industries for decades. |
The automotive industry uses Code 39 for parts tracking, but must accommodate the Minimum Length Problem by using larger labels or longer part numbers to make the fixed overhead less pronounced. The defense sector, through LOGMARS, relies on Code 39 for its self-checking properties, accepting the length overhead as a necessary cost for reliability. Healthcare faces unique challenges in encoding short patient identifiers on wristbands, where space is limited, and often responds with high-density printing or alternative symbologies. Logistics and warehousing use Code 39 for inventory tracking, optimizing label placement and scanner settings to work around the length constraints. The electronics industry has largely moved away from Code 39 for direct component marking due to the Minimum Length Problem, preferring 2D codes for tiny components but still using Code 39 for larger items and packaging. Postal and shipping services use Code 39 for tracking numbers, where the longer codes help mitigate the overhead, but they are still mindful of the problem when encoding short service codes. |
Technical responses to the problem include scanner configuration with length qualification settings, the development of Code 39 Extended (which, however, doubles the length for lowercase letters and ASCII characters), and the adoption of alternative symbologies like Code 128 where higher density is required. The self-checking nature of Code 39 and its ease of implementation have ensured its continued relevance. |

|
The Minimum Length Problem is a reminder that every engineering solution carries with it a set of constraints. Code 39's constraints have been well-understood for nearly half a century, and yet the symbology persists because its advantages---alphanumeric capability, self-checking reliability, and universal compatibility---outweigh its inefficiencies for a vast range of applications. It is a testament to the enduring value of a design that got the big things right, even if the small details require a little extra room. |