Barcode Technology

Barcode History

Barcode Label Paper

Barcode Printer

Barcode Application

Inventory Management

AI Barcode QRCode

Barcode Scanner

Barcode Software

Barcode Software B

Barcode Software C

Barcode Software D

Barcode Software E

New Technology A

New Technology B

Robot Technology

Barcode Types

Barcode Types B

Barcode Types C

Barcode Types D

Barcode Types E

Barcode Types F

Electronic Technology

Psychology at Work

Barcode Technology and Barcode Software Related   <<< Back to Directory <<<

Code 39 Barcodes: A Technical Deep Dive Into the Iconic (Code 3 of 9) (P42)

Chapter 42: Disadvantages - No Bidirectional Decoding Certainty

Code 39 is celebrated for its bidirectional scanning capabilitya feature that allows operators to scan a barcode from left to right or right to left with equal ease. This flexibility is a cornerstone of its practicality in fast-paced industrial and logistics environments. However, this very feature conceals a subtle but significant vulnerability: the lack of a true reversal-protection pattern. While the asterisk (*) start/stop characters provide a clear signal for decoding, the underlying symmetry in the code's structure means that certain sequences, when scanned in reverse, can produce a different but still valid sequence of characters. This chapter explores the nature of this bidirectional ambiguity, its technical roots, andmost importantlyhow this limitation manifests across various industries. We will examine real-world applications where mis-decodes have occurred and discuss the countermeasures that professionals employ to mitigate this inherent weakness.

The Allure of Bidirectional Scanning

In the early days of barcode technology, the ability to scan a symbol from either direction was a significant advancement. Code 39, invented in 1974 by Intermec, was among the first symbologies to achieve widespread adoption partly because it freed operators from the constraint of orienting the scanner perfectly . In a warehouse, a worker could pick up a handheld scanner and pull the trigger without worrying about whether the laser was sweeping from the left edge or the right edge of the label. This 'omni-directional' potential, while not truly omni-directional like a 2D matrix, provided a level of operational efficiency that was revolutionary for its time.

The secret to this flexibility lies in the start and stop characters, which are always represented by the asterisk (*). These special markers bookend the data, signaling to the decoder where the barcode begins and ends. When a scanner reads a Code 39 symbol, it looks for this specific pattern to establish orientation. If it encounters the start pattern first, it decodes forward; if it encounters the stop pattern first, it knows to reverse the interpretation of the data .

However, beneath this seemingly robust system lies a fundamental encoding quirk that has plagued developers and system integrators for decades.

The Anatomy of the Ambiguity

To understand the disadvantage, we must briefly revisit the encoding structure of Code 39. Each character is composed of nine elements: five bars and four spaces . Of these nine elements, exactly three are wide, and six are narrow. This 'three of nine' pattern is how the symbology derives its name. The arrangement of these wide and narrow elements determines the character.

This structure is inherently self-checking. If a single bar or space is misread (a narrow element read as wide, or vice versa), it is highly unlikely that the resulting nine-element pattern will correspond to a valid character . This is a strength. The weakness, however, is that the code is not designed to prevent a situation where the entire sequence of characters, when reversed, happens to form a different valid sequence.

Consider the start/stop asterisk itself. The pattern used for this character is unique, but the data characters that follow are arranged in a line. If you take a barcode that encodes the data 'ABC' and you scan it from right to left, the scanner's firmware is smart enough to reverse the sequence. It reads the stop pattern, realizes it is scanning backward, and correctly decodes 'ABC.'

But what if the encoded data itself is a palindromeA palindrome is a sequence that reads the same forward and backward, like 'ABA.' In this case, scanning forward yields 'ABA' and scanning backward also yields 'ABA.' The system works perfectly.

The real trouble begins with sequences that are not palindromes but are composed in such a way that the reverse sequence happens to be a different, valid piece of data in the same database. For instance, the code for 'ABC' is one pattern. The code for 'CBA' is another. If a barcode for 'ABC' is damaged or partially obscured, a scanner might misinterpret the width of a line or the spacing, causing it to read the sequence as if it were a different character set, leading to a mis-decode. More insidiously, the lack of a dedicated 'direction' bita check character that specifically verifies the order of the sequencemeans that some concatenations of characters can be misread when reversed, particularly if the scanning software is configured to allow lengths without start/stop enforcement .

The Mitigation: Asterisks and Software Controls

The industry has developed several methods to combat this ambiguity. The most fundamental is the mandatory use of the start and stop asterisks. Barcode reading SDKs and scanners typically have a setting to enforce that a Code 39 barcode must begin and end with these characters. If this setting is disabledallowing the reader to decode a barcode that is just a string of data without the asterisksthe risk of mis-decoding skyrockets. As one software vendor warns, 'Without a start/stop * character, a Code 39 barcode reads with 2 different values, left to right, and right to left' .

To mitigate this, most high-end scanners utilize advanced algorithms that compare the forward and backward reads. If a code is scanned bidirectionally, the scanner often takes two reads and compares them. If there is a discrepancy, the scanner rejects the read and asks for a re-scan. Furthermore, system administrators often limit the decode length range. By restricting the barcode to a specific number of characters, they reduce the probability that a random reversal will produce a valid code within that specific length .

Real-World Applications: Where Ambiguity Meets Reality

Despite these technical solutions, the bidirectional ambiguity remains a persistent challenge across several industries. Here are examples of how this disadvantage manifests in the real world.

1. Automotive Manufacturing: The VIN Conundrum

The automotive industry is a heavy user of Code 39, specifically for Vehicle Identification Numbers (VIN) and parts labeling . VINs are alphanumeric strings that follow a strict global standard. They are long, typically 17 characters, and are critical for tracking vehicles through assembly, logistics, and recalls.

The Risk: The Department of Defense (DoD) and automotive standards often mandate Code 39 for its durability and simplicity. However, a VIN contains a check digit in position nine, but the structure of the VIN itself can lead to issues. For example, consider a VIN that contains the segment 'S88'. The reverse of this is '88S'. While '88S' might not be a valid VIN prefix, the potential exists for a misread on a smaller part label. More critically, when scanning parts on a fast-moving assembly line, if the barcode is smudged or the contrast is low, the scanner might misinterpret the wide-to-narrow ratio. If the scanner is set to read 'both directions' and the start/stop pattern is ambiguous due to damage, it might attempt to decode a reversed sequence. A misread VIN could result in a part being installed on the wrong vehicle or a chassis being misidentified, leading to costly production errors and safety recall complications.

The Mitigation: Automotive facilities often use high-quality, high-contrast thermal transfer labels and invest in high-end scanners that incorporate redundancy checks. They also often restrict the use of specific subsets of characters where possible to reduce the risk of reversal ambiguity.

2. Healthcare: Patient Safety at Stake

In the medical field, HIBCC (Health Industry Business Communications Council) standards often accommodate Code 39 for labeling medical devices, pharmaceuticals, and patient wristbands . Accuracy is not just a matter of efficiency; it is a matter of life and death.

The Risk: Imagine a hospital using Code 39 to label blood bags. A blood bag is labeled with a unique identifier, perhaps 'A123B.' The reverse of this sequence is 'B321A.' While these two codes are different, a damaged barcode could cause the scanner to 'stitch' the code incorrectly. Barcode stitching is a process where a scanner combines partial reads from a damaged or long barcode to get a complete string. Without a check digit, Code 39 is vulnerable to stitching errors that result in a mis-decode, especially when the encoded content has repeat patterns . A misread of a blood type identifier could lead to a transfusion mismatch, which is a catastrophic medical error. Similarly, mislabeling a patient wristband could result in the wrong medication being administered.

The Mitigation: In such critical applications, hospitals are increasingly moving toward Code 128 or 2D symbologies like Data Matrix, which include robust error correction. However, legacy systems still rely on Code 39. To compensate, they implement strict label printing quality controls and use scanners with firmware that runs multiple decode passes and rejects ambiguous reads.

3. Logistics and Warehousing: The Pick and Pack Problem

The logistics industry relies heavily on Code 39 for tracking parcels, pallets, and bins. It is popular because any old printer can print it, and nearly any scanner can read it. However, the low data density of Code 39 means that large labels require a lot of horizontal space .

The Risk: A typical warehouse scenario involves a worker picking items and scanning a bin location. If the bin is labeled with a code that reads 'LOC-12', a damaged label could be read as '21-COL' (the reverse). The warehouse management system (WMS) is looking for bin locations. If 'LOC-12' and '21-COL' are both valid locations in the database (or if '21-COL' isn't a location but a random string that triggers an error), the worker has to stop and manually enter the number, slowing down throughput. In high-volume sorting facilities, this ambiguity introduces friction. Furthermore, because Code 39 is variable length and lacks a mandatory check digit, 'stitching' misdecodes are more common .

The Mitigation: Logistics companies often impose length limits in their scanners. By telling the scanner to only accept codes of a specific length (e.g., 8 characters), they prevent the scanner from accepting a shorter reversed read. They also rely on 'check digit' algorithms (Mod 43) to validate the scan. While optional, many internal logistics systems require a Mod 43 check digit to ensure the read is mathematically valid .

4. Defense and Government: The LOGMARS Standard

The Department of Defense (DoD) uses a specific standard called LOGMARS (Logistics Applications of Automated Marking and Reading Symbols), which is based on Code 39 . This standard mandates the use of Code 39 for identifying assets.

The Risk: The DoD requires a Mod 43 check digit to validate data. However, the bidirectional ambiguity remains a threat to system integrity. Spare parts are often stored in remote depots. If a part label is dirty, a scanner might misread the sequence, leading to a requisition for the wrong part. In the military, sending the wrong tank tread or avionics component to a forward operating base is not just an inconvenience; it is a logistical breakdown. A reverse read is less likely to occur on a pristine label, but in the field, labels are often damaged. The lack of a direction-reversal-protection pattern means that an encoded 'B' might be misread as 'P' (which is the reverse of 'B' in Code 39 encoding) . This specific ambiguity is a known issue.

The Mitigation: The military heavily enforces strict adherence to print quality standards and uses high-spec industrial scanners that have advanced image processing to recognize the distinct start/stop characters, even in poor conditions. They also often print the data in human-readable text below the code, allowing for a manual double-check in case of a scan error.

5. Postal and Shipping: The Space Constraint

While some postal services have moved to Code 128, Code 39 is still used in some shipping labels due to compatibility with older sorting machines .

The Risk: Shipping labels contain tracking numbers and ZIP codes. If a shipping label uses Code 39 and the sequence is long, the barcode becomes wide. On a small package, this forces the operator to use a narrow X-dimension (bar width). This reduces the tolerance for printing imperfections. If the ink spreads, the wide bars become indistinguishable from narrow bars. A scanner might misread a wide bar as narrow due to a smudge, changing the binary pattern. When reading in reverse, if the start/stop character is compromised, the scanner might read the data as an entirely different tracking number. This would route the package to the wrong sorting lane, causing delays.

The Mitigation: The Universal Postal Union recommends using Code 128 due to its higher data density and mandatory check digit . In systems that cannot migrate, operators are trained to print labels at high DPI (dots per inch) and use low-speed scanning lanes to give the scanner more time to calculate the orientation and compare it to the human-readable text.

6. Government ID and Vehicle Registration

Many government agencies use Code 39 for vehicle registration documents, driver's licenses, and tax forms. It is easy to generate and print on standard paper.

The Risk: Fraud and data entry errors. For example, a vehicle identification number (VIN) printed on a car title might be scanned. A misdecode on a damaged document could lead to a mismatch between the scanned data and the visually printed text. An '8' and a 'B' are different in the Code 39 mapping. If the code is reversed, the resulting data might be processed as a different vehicle.

The Mitigation: Government agencies rely on the human-readable translation printed below the barcode. The scanner is used for data entry, but the operator is required to visually verify the barcode translation against the printed number. This two-factor verification prevents a misdecode from causing a serious error.

Technical Workarounds and Best Practices

Given the industries' reliance on Code 39, various technical measures have been developed to mitigate the risks of bidirectional misdecoding.

The Mod 43 Check Digit: While optional, the inclusion of a Mod 43 check digit is the most common defense. The check digit is calculated based on the weighted sum of the data characters. If the reversed sequence has a different weighting, the check digit calculation will fail, and the scanner will reject the code .

Length Restrictions (Truncation): As mentioned, limiting the decode length range prevents the scanner from stitching a partial read .

Mandatory Start/Stop Enforcement: This is a firmware setting in most modern scanners. It ensures that the asterisk patterns must be present on both ends of the code. This significantly reduces false positives .

Image-Based Scanners: Unlike laser scanners, which just see lines, image-based scanners take a picture of the barcode. They use software to determine the orientation based on the aspect ratio of the entire label, not just the timing of the bars and spaces. This allows for more robust reverse-reading detection.

Extended Code 39: This version allows for the encoding of the full 128-character ASCII set by using pairs of standard Code 39 characters. While this increases data density, it also introduces additional complexity for the decoder, as the scanner must be specifically configured to read Extended Code 39 . However, this expansion doesn't inherently fix the bidirectionality issue unless paired with proper orientation checks.

Symbology Replacement: For new applications, many system integrators are choosing Code 128 or GS1-128. These symbologies have higher density and require a mandatory check character (Code 128 uses a weighted Mod 103 algorithm), making them much safer for critical applications.

Summary and Final Analysis

The bidirectional decoding uncertainty of Code 39 is not a 'bug' but rather a featureor an artifactof its design. The ability to scan in either direction was a revolutionary leap forward for automation. However, the convenience came at the cost of deterministic directionality. Without a check digit, a specific combination of wide and narrow elements can be misinterpreted when read backward, leading to a sequence that is either entirely invalid or, worse, valid but incorrect.

The Technical Reality

The core of the problem is that Code 39's encoding is not directional. It reads the presence or absence of wide elements. While the start/stop asterisk provides a 'signpost,' it does not encode a 'bit' that says 'I came from the left.' The result is that a string like 'ABC' might read as 'CBA' if the scanner tries to decipher the sequence without properly identifying the asterisks. In practice, high-quality scanners can differentiate the asterisks perfectly, but in imperfect environmentswith smudges, ink spread, or poor lightingthe margin for error shrinks.

The Industry Response

Across all the industries examinedautomotive, healthcare, logistics, defense, and governmentthe response to this disadvantage has been layered. The optional Mod 43 check digit is a crucial defense, serving as a mathematical proof of the data's integrity. Length restrictions and strict enforcement of start/stop patterns are another layer of protection. In high-risk healthcare settings, there is a notable trend toward leaving Code 39 behind and adopting more robust symbologies.

However, Code 39 endures. Its simplicity ensures that it works with nearly every hardware and software platform in existence. It remains a 'universal language' for legacy systems. The practical solution for businesses is not to fear the ambiguity but to architect their systems to account for it. This involves:

1. Implementing Strict Length Policies: Define the exact length of the barcode to prevent 'stitching' errors.

2. Enabling the Check Digit: Generate and verify Mod 43 check digits.

3. Enforcing Start/Stop Characters: Disabling 'NoSS' (no start/stop) decoding.

4. High-Quality Printing: Ensuring the wide-to-narrow ratio (2:1 or 3:1) is strictly maintained to preserve character distinction.

The Future Outlook

As technology advances, the limitations of Code 39 become more pronounced. The 'No Bidirectional Decoding Certainty' disadvantage is a significant factor driving the adoption of Code 128 and 2D symbologies like Data Matrix. Code 128's mandatory check digit and higher density make it a superior choice for new applications. However, the sheer number of legacy Code 39 barcodes in circulation ensures that the symbology will remain relevant for decades.

In conclusion, this disadvantage is a testament to the engineering trade-offs of the 1970s. Simplicity and versatility were prioritized over absolute cryptographic certainty. For most applications, this trade-off is acceptable. For critical applications where safety and inventory accuracy are paramount, the industry has learned to impose its own checks and balances to bridge the gap left by the absence of a true reversal-protection pattern. The key to successful implementation of Code 39 is awareness: knowing that the risk exists and taking the prudent steps to mitigate it.

Final Recap

The lack of true bidirectional certainty in Code 39 means that while the code can be scanned from either direction, the risk of a mis-decodewhere the scanner interprets the reversed sequence as a valid but different codeis a real operational hazard. This chapter outlined how this affects industries from automotive manufacturing to healthcare, where misreads can cause assembly errors or patient safety risks. The defenses are robust but optional: implementing Mod 43 check digits, enforcing strict length limits, using mandatory start/stop asterisks, and ensuring high print quality. Ultimately, Code 39 remains a powerful workhorse, but users must design their systems to accommodate this inherent ambiguity to maintain data integrity.

 

EasierSoft Barcode Label Design & Bulk Printing Software

---- Use Excel Data to Batch Print Barcodes on Label Sheets or Roll Labels  

---- How to use this barcode software

Download:  Free Barcode Software + Barcode Label Designer

Download Free Barcode Software at Softonic

     Download at CNET

Once you obtain a GS1/UPC/EAN barcode, or other barcode type and QR code, you can use our free software to batch print barcode labels onto Roll label paper using a professional label printer, or to batch print barcodes onto Avery 5160 label sheets using a regular laser or inkjet printer. Our software has free and paid versions.

The free version fully meets your needs for batch printing GS1/UPC/EAN barcodes. The paid version can import data from Excel and databases to batch print barcode labels with different values.

How to Start

Input Data

Import Excel Data

Print Barcode

Barcode Format

Label Designer

All Screen Shot

Export Barcode Image

Save Template

Output Word Excel

How to Use & FAQ:

Label Designer

Edit data in Label designer

Label Designer - Add new label

Label Designer - Printing

Set the barcode label format to be printed

Other Barcode Label Format Settings

Barcode types supported by this program

Barcode Label Font Settings

Configuring the Barcode Print Rotation

Text Alignment for Barcode Labels

Automatically Adjusting Barcode Width

Text Beneath the Barcode

Configuring Barcode Size

Auto Calculate the Barcode Size

Export Barcode images

Export Barcode Image Format

File Names for Exported Barcode

Resolution of Exported Barcode Images

Fixed Folder for Exporting Barcode

Default Barcode Image Export Format

Print bulk barcodes quickly

Print barcodes to Avery 5160 label

How to bulk Barcode Printing

Sample - Avery 5162 (2x7) Label Sheet

Example: Print barcodes to 5*3cm roll

Example: Print barcodes to 5161 label

Example: Print barcodes to 5162 label

Example: Print barcodes to 5163 label

Example: Print barcodes to 5164 label

Example: Print portrait orientation 5164

Example: Print barcodes to 5167 label

Example: Print barcodes to 5168 label

Example: Print portrait orientation 5168

Example: Print barcodes to 5169 label

Example: Print barcodes to 5660 label

Example: Print barcodes to 5661 label

Example: Print barcodes to 5662 label

Example: Print barcodes to 5663 label

Example: Print barcodes to 5664 label

Example: Print portrait orientation 5664

Example: Print barcodes to 5873 label

Example: Print barcodes to 5874 label

Two ways to import Excel data

Import Excel Data - Pro Edition

Import Excel Data - Std Edition

Import Data from Excel - Detail

Load Data From Excel File

Data Editing Table

Copy Data From Excel

Four ways to input barcode data

Highlights

Excel integration: Import data directly from Excel to generate and print barcodes in bulk.

Label designer: Create complex labels with multiple barcodes, text, logos, and shapes.

Batch printing: Print thousands of barcodes at once using standard inkjet/laser printers or professional barcode printers.


Flexible editions:

Standard Edition: Simple batch printing with Excel data.

Professional Edition: Adds command-line automation for workflow integration.

Label Designer Edition: Advanced design features for complex labels.


Why Choose Our Barcode Solutions?

Cost-effective: Free online generator and permanent free desktop version available.

Easy to use: No technical expertise required—just input data and print.

Versatile: Supports nearly all 1D and 2D barcode types, including QR codes.

Trusted: Recommended by CNET and widely downloaded by users worldwide.


Suitable Use Cases

Small businesses and startups needing quick barcode labels for products.

Retailers and online sellers managing inventory with batch barcode printing.

Manufacturers requiring sequential or custom barcode labels for packaging.

Educational and testing environments where barcodes are used for tracking.

 

 

CONTACT

cs@easiersoft.com

If you have any question, please feel free to email us.

 

https://free-barcode.com

 

<<< Back to Directory <<<     Barcode Generator     Barcode Freeware     Privacy Policy