Why Do I Need to Add Asterisks (*) at the Beginning and End of the Barcode Value When I Generate a Code 39 Barcode Using a Font File? |
Code 39, also known as 3 of 9, is a widely used barcode symbology that encodes alphanumeric characters, including upper-case letters (A-Z), digits (0-9), and a few special characters (-, ., $, /, +, %, and space). It is one of the most common barcodes used for inventory management, asset tracking, and other applications where simplicity and readability are key. However, when generating a Code 39 barcode using a font file, you must surround the data with asterisks (*) at the beginning and end of the value. This is not just a design choice but a requirement that ensures proper encoding and scanning of the barcode. Below, we will break down in detail the reasons behind this practice. |

|
1. Code 39 Structure and Encoding |
To understand why asterisks are necessary, it's important to first grasp how Code 39 encodes data. Code 39 relies on a specific pattern of bars and spaces to represent each character. Each character in the Code 39 standard is represented by a series of five bars and four spaces. These bars and spaces have specific widths that represent different characters from the Code 39 character set. |
In Code 39, the asterisk symbol (*) is used as both a start and stop character. This is a fundamental part of the encoding scheme, as it signals to both the software generating the barcode and the scanner reading the barcode that the value is a valid Code 39 barcode. |

|
2. The Role of the Asterisk in Code 39 |
In Code 39, the asterisk (*) has a very specific function. It is designated as the 'start' and 'stop' character. In fact, the encoding of a Code 39 barcode includes these special characters at both the beginning and end of the data string. This means that when you generate a barcode, whether manually or using a font file, the barcode's value must begin and end with an asterisk to be correctly recognized by barcode scanners. |
Here's why: |
Start character: The asterisk signals to the barcode scanner that the scanning process should begin and tells it that the next character will be part of the barcode's data. |
Stop character: Similarly, the asterisk at the end tells the scanner that the barcode's data has ended and that it should stop reading the barcode. |
This structure ensures that the entire barcode is interpreted correctly, with the scanner knowing when to start reading and when to stop, avoiding errors in the scanning process. |

|
3. Code 39 Barcode Font and the Necessity of Asterisks |
When generating a barcode with a font file (such as a TrueType or OpenType font), the barcode is essentially displayed as text. The font takes each character of the barcode data and translates it into the appropriate sequence of bars and spaces to form the visual representation of the barcode. The problem, however, is that the font alone does not inherently know where the start and stop characters should be. Therefore, it relies on the inclusion of the asterisks as part of the barcode data to generate the correct pattern for scanning. |
Without the asterisks, the barcode would be incomplete or malformed, as the start and stop characters are necessary for the scanner to identify and decode the barcode correctly. Therefore, if you generate a Code 39 barcode using a font and omit the asterisks, the barcode would not be valid, and scanners would likely fail to read it or produce incorrect results. |

|
4. Compatibility with Barcode Scanners |
Barcode scanners are designed to recognize specific patterns and symbols within a barcode. For Code 39, the scanner expects to see the asterisk as both the start and stop character. Most barcode scanners are configured to automatically detect the beginning and end of the barcode based on these asterisks. |
When a barcode is presented to a scanner, the scanner will check for the presence of these start and stop characters. If they are absent, the scanner may not be able to detect the correct start or end of the barcode, leading to a failure in reading the barcode correctly. It's a bit like a sentence without punctuation marks-the scanner can't know where the data begins or ends without the asterisks to indicate the start and stop positions. |

|
5. The Significance of Code 39 in Practical Applications |
While there are many different barcode symbologies, Code 39 remains one of the most popular for various industries, including manufacturing, retail, healthcare, and logistics. The inclusion of the asterisks ensures that the barcode is properly formatted for consistent and accurate scanning in a wide range of applications. If the asterisks were not included, it would create confusion and errors in these real-world scenarios. |
In practical terms, Code 39 barcodes are frequently used in asset management systems, package labeling, and inventory systems, all of which rely on efficient and reliable barcode scanning. Omitting the asterisks in such contexts could result in stock mismanagement, shipment delays, and other costly mistakes due to scanning errors. |

|
6. Asterisks and Barcode Generation Tools |
When using barcode generation tools or barcode font files, it's important to follow the correct syntax for generating valid barcodes. Many tools will automatically add the asterisks when you input the barcode data, but if you're manually creating the barcode or working with a custom font, you must ensure that you include the asterisks at the beginning and end of the string. |
This requirement is not just specific to manual font generation. Other barcode generation methods, including software applications and online barcode generators, also typically follow the same principle by requiring or automatically adding asterisks. This is because the Code 39 standard mandates that the barcode must be framed by the asterisks for proper encoding. |

|
7. The Impact of Missing Asterisks on Scanning Performance |
If the asterisks are missing from a Code 39 barcode, it can lead to several potential problems during the scanning process: |
Scanner Misinterpretation: Without the start and stop characters, the barcode scanner may misinterpret the encoded data, leading to incorrect reads or failed scans. |
Scanning Delays: Scanners may take longer to attempt to decode a barcode without the asterisks, as they may not be able to identify the exact boundaries of the data. |
Increased Error Rates: Missing asterisks can significantly increase the chances of error during scanning, especially in environments where barcodes are read quickly or in poor lighting conditions. |
In a high-volume environment, these issues can lead to operational inefficiencies, as scanners may need to retry reads multiple times, slowing down the workflow and creating frustration for users. |

|
8. Asterisks and the Human Readable Label |
In addition to the barcode itself, many systems also display a human-readable version of the data beside or below the barcode. This human-readable label is typically a simple text string that mirrors the data encoded in the barcode. If the asterisks were omitted from the barcode but included in the human-readable label, it could create confusion for users or operators who rely on the label for verification. |
For example, if a barcode is being used to track a part number, the part number should match the data encoded in the barcode, including the asterisks. Omitting the asterisks from the barcode while keeping them in the human-readable label could result in discrepancies and errors during manual verification. |

|
9. Summary of Why Asterisks Are Needed |
To summarize, the inclusion of asterisks at the beginning and end of a Code 39 barcode is required for the following reasons: |
Start and Stop Characters: Asterisks signify the start and stop of the barcode data, ensuring proper decoding by scanners. |
Barcode Font Generation: The asterisks are necessary when using barcode fonts, as they provide the proper structure for the barcode. |
Scanner Compatibility: Barcode scanners expect the asterisks to identify the beginning and end of the barcode, ensuring accurate and efficient scanning. |
Practical Applications: Without the asterisks, barcodes may be unreadable or incorrectly scanned, leading to errors in critical applications like inventory management. |
Generation Tools: Barcode generation tools and software generally require or automatically insert the asterisks to ensure proper formatting. |

|
10. Conclusion |
The use of asterisks (*) at both the beginning and end of the barcode value is a non-negotiable requirement for generating valid Code 39 barcodes. This practice ensures compatibility with barcode scanners, guarantees proper encoding and decoding, and contributes to the reliability of barcode systems in real-world applications. Whether you're using a barcode font, a barcode generator, or manual encoding methods, understanding and adhering to this rule is crucial for ensuring the accurate and efficient operation of barcode-based systems. |

|
Why Don't Other Types of Barcodes Require an Asterisk (*) at the Beginning and End of the Barcode Value? |
While the use of the asterisk (*) at the beginning and end of a barcode value is a specific requirement for Code 39, it is not a universal characteristic across all barcode symbologies. The reasons why other types of barcodes do not require the asterisk symbol at the beginning and end of their encoded data stem from differences in the structure, encoding rules, and overall design of each barcode standard. Below, we explore why the asterisk is specific to Code 39 and not needed for other types of barcodes. |
1. Different Barcode Structures and Start/Stop Characters |
Every barcode symbology is designed with a particular structure that determines how the data is represented visually. The need for start and stop characters, like the asterisk in Code 39, is influenced by the way data is encoded and read. |
1.1 Code 39 and the Role of the Asterisk |
In Code 39, the asterisk (*) serves as both the start and stop characters. These symbols are necessary because: |
Code 39's design is relatively simple, and the bars and spaces that represent characters in the barcode have no inherent distinction for where the data begins or ends. |
The asterisk acts as a unique marker to clearly indicate these positions, ensuring proper decoding by scanners. |
Without the asterisks, a scanner might not know where the barcode data begins or ends, leading to potential misreads or failed scans. This is not a problem for all barcode types, which leads to the absence of asterisks in many other symbologies. |
1.2 Start/Stop Characters in Other Barcodes |
Other barcode types, such as UPC, EAN, Code 128, QR codes, and DataMatrix, employ different methods for marking the boundaries of the data: |
UPC/EAN barcodes do not require asterisks. These symbologies use specific guard bars or start/stop patterns within the barcode itself to mark the beginning and end of the encoded data. For instance, in UPC and EAN barcodes, specific patterns of bars at the edges of the barcode signify the start and stop points. |
Code 128 also has a built-in method for identifying the start and stop of the encoded data, which uses start codes and stop codes embedded directly into the barcode pattern itself. |
QR codes and DataMatrix codes have complex algorithms for encoding data into two-dimensional matrices and use predefined patterns (such as finder patterns and alignment patterns) to mark the boundaries of the data. These barcodes don't require additional start or stop characters like the asterisk because the entire matrix is structured in a way that allows the scanner to easily recognize the beginning and end of the data. |

|
2. The Purpose of Start and Stop Characters |
The role of start and stop characters is not universally necessary across all barcode standards. It is particularly crucial in Code 39 because: |
Code 39 is a relatively simple linear barcode symbology that lacks the internal structure to distinguish between the beginning and end of data on its own. |
In contrast, other barcode types have inherently structured encoding that includes specific symbols, patterns, or guards designed to signal where the data begins and ends, which eliminates the need for external markers like asterisks. |
2.1 UPC and EAN: Built-in Start/Stop Indicators |
For example, in UPC (Universal Product Code) and EAN (European Article Number) barcodes, the start and stop are indicated by specific guard bars at either end of the barcode. These guard bars are different from the regular bars and spaces in the barcode, providing clear demarcation of the data boundaries without needing an additional character like the asterisk. |
Similarly, the EAN-13 barcode has an even number of guard bars at the start and end, while the UPC-A barcode has a unique pattern at the beginning and end of the sequence. These built-in start and stop indicators ensure that the barcode can be correctly read by scanners, removing the need for the asterisk. |
2.2 Code 128 and Other 1D Barcodes |
In the case of Code 128, the barcode symbology employs start codes and stop codes to define the beginning and end of the encoded data. Each character in the Code 128 set corresponds to a unique binary pattern, and the barcode includes special 'start' codes at the very beginning and 'stop' codes at the very end to delineate the data. |
These built-in start and stop codes are integrated into the barcode's overall structure, making the asterisk unnecessary for demarcation. The scanner can quickly recognize where the data begins and ends because these codes are part of the barcode itself. |

|
3. Two-Dimensional Barcodes: No Need for Asterisks |
Two-dimensional barcodes like QR codes, DataMatrix, and PDF417 have a very different structure compared to linear barcodes. The need for start and stop characters is not required because: |
QR codes use a complex matrix structure with specific patterns (such as finder patterns in three corners) that clearly indicate the boundaries of the barcode. These patterns allow the scanner to locate the barcode and identify its orientation. |
DataMatrix codes also rely on grid patterns with distinctive markers that help scanners identify the data boundaries. |
Because these two-dimensional barcodes have built-in alignment and positioning markers, there is no need for start or stop characters like an asterisk. The barcode's structure inherently provides the information necessary for the scanner to identify the correct data region. |

|
4. The Role of Symbology Complexity |
The simpler structure of Code 39 is a contributing factor in why it requires start and stop characters like the asterisk. Code 39 was developed in the early 1970s for industrial and military use, where simplicity and ease of implementation were important. The use of asterisks was a straightforward solution to ensure that the data boundaries could be clearly identified. |
In contrast, newer barcode standards were developed to support more complex data encoding and error-checking. These symbologies, such as QR codes or DataMatrix, can encode more data in a smaller area, and they incorporate features like error correction and built-in start/stop markers within their encoding schemes. |

|
5. Compatibility and Practicality |
The reason why Code 39 uses asterisks as delimiters is rooted in compatibility with existing systems at the time of its creation. When Code 39 was first developed, scanners were less sophisticated than modern devices, and the asterisk helped ensure that the start and stop points of the barcode were clearly defined for those early devices. |
In contrast, modern barcode systems, especially those using two-dimensional barcodes, can handle more complex encoding and detection algorithms. These barcodes use advanced error-correction techniques and positioning algorithms, making the use of start/stop characters like asterisks unnecessary. |

|
6. Barcode Scanning Techniques |
Modern barcode scanners are highly advanced and often support a wide range of barcode types. Scanners that read Code 39 and Code 128 can often automatically identify which symbology is being scanned, while scanners that read QR codes or DataMatrix use algorithms that help the scanner detect the data boundaries even if the barcode is slightly misaligned or damaged. |
For linear barcodes like Code 39, the asterisk helps improve scanner efficiency by marking clear boundaries. For two-dimensional codes, the advanced pattern recognition and alignment features of the barcode symbology make additional boundary markers unnecessary. |

|
7. Summary: Asterisks in Code 39 vs. Other Barcodes |
In conclusion, the reason why Code 39 requires the asterisk (*) at the beginning and end of its barcode value while other types of barcodes do not can be attributed to the following: |
Design Simplicity: Code 39 is a relatively simple barcode standard that does not have the internal structure to mark the boundaries of the encoded data. Therefore, the asterisk is used as a clear marker for the start and stop positions. |
Start/Stop Patterns: Other barcode types, such as UPC, EAN, Code 128, and QR codes, have built-in start/stop patterns or more sophisticated encoding methods that eliminate the need for the asterisk. |
Advancements in Barcode Technology: As barcode technology has advanced, especially with the rise of two-dimensional barcodes, more complex algorithms have been developed to ensure that scanners can reliably detect and decode the data without the need for extra symbols like asterisks. |
Ultimately, the use of the asterisk in Code 39 is a legacy feature specific to its design, whereas newer barcode standards have evolved to incorporate different methods for identifying the start and stop points of the encoded data. |