What's a Bar Code?
Bar Code Symbologies
Bar code systems can use several symbologies. A symbology is equivalent to a language. Each symbology has strengths and weaknesses. Many symbologies are around for historical or political reasons, while others have definite technical advantages.
In many systems, you must conform to a company-specified symbology. If this is the case, then you don't have much choice unless you can give the company a good reason to change. In other systems, you are given the choice to use any symbology you wish. Choose your symbology carefully. There are several factors to use in choosing a symbology, including:
To summarize: For general-purpose use, Code 128 is usually the best choice. It provides use of the full (128-character) ASCII set as well as the best readability and reliability available. If you are making a general-purpose system that needs to read only numbers and uppercase letters, you can use Code 39. If you need numbers only, you should use Interleaved 2 of 5 or Code 128. In any case, avoid symbologies that require reconfiguration of the reader, and your life will be easier.
Checksums
Checksums are additional characters appended to bar codes to guarantee good reads. Checksums are necessary on some bar codes that are prone to errors. For example, Interleaved 2 of 5 is a very dense, numeric-only bar code, but it is prone to substitution errors. You should always use a checksum on this code. Other codes, such as Code 128 and Code 39, are self-checking and seldom require a checksum. Most bar code readers can be configured to use checksums in these ways (on symbologies where there is a choice):
Choice 2 is generally the best. Some symbologies, such as UPC, require a checksum, and the checksum processing is invisible to the programmer. Choice 2 guarantees only a good read. It does not guarantee a good connection to your computer. Choice 3 guarantees both a good read and a good connection between the computer and the bar code reader. It requires special software on the computer to verify the checksum. This gives the most secure system, but at the expense of extra logic in your program.
Code 128
This symbology is a very compact bar code for all alphanumeric applications. The full (128-character) ASCII character set can be encoded in this symbology without the double characters found in extended Code 39. If the bar code has four or more consecutive numbers (09), the numbers are encoded in double-density mode (where two characters are encoded into one character position). Code 128 also has five special, nondata function characters. These are generally used to set reader parameters or return parameters. Code 128 actually has three different character-code subsets. It has two forms of error checking, making it a very stable bar code. Checksums are not required. If you have your choice, Code 128 is generally the best all-around choice you can use.
Code 39
Code 39 (or Code 3 of 9) is the most common bar code in use for custom applications. It is popular because it can support both text and numbers (AZ, 09, +,-, ., and ), it can be read by almost any bar code reader in its default configuration, and it is one of the oldest of the modern bar codes. Code 39 is a variable-width bar code, and it can support any number of characters that the reader can scan. Code 39 is specified in many military and government specifications. Code 39 bar codes are self-checking and are not prone to substitution errors. They generally do not require checksums.
Interleaved 2 of 5
Also known as I2of5, this is a numeric-only bar code that prints out a little larger than the UPC-A bar code when 10 digits are encoded. This symbology has the flexibility to encode any even number of digits. If you have an odd number, a leading zero is added. This bar code is an excellent candidate for numeric-only applications, and it is the best symbology to use for fixed-mount readers. Because Interleaved 2 of 5 is prone to substitution errors, you should always use a checksum.
UPC (Universal Product Code)
UPC is the standard bar code for items for sale to the public. It is the code seen on items at the local supermarket. UPC-A is a fixed-length, numeric-only bar code. It contains 1 digit for a system number, 5 digits for the manufacturer number, 5 digits for the product number, and one checksum digit. The position and value of the digits is standardized by a grocery industry committee. UPC-A and UPC-E also allow two- or five-digit supplemental numbers. UPC-A and UPC-E codes have an automatic checksum. UPC-E is ideal for small packages, because it is the smallest bar code available. This symbology contains the same information as UPC-A, except that at least four zeros are suppressed. Only tags with the system character of 0 can be encoded with this symbology. UPC-A and UPC-E codes have an automatic checksum. Interleaved 2 of 5 is almost as dense and does not have the format considerations.
Extended Code 39
Extended Code 39 is a derivative of Code 39. This symbology uses combinations of two standard Code 39 characters for every character in the ASCII character set (0-127). This symbology allows lowercase letters and control characters, at the expense of size. This makes the code very big if you have very many lowercase or special characters. Most bar code readers in their default configuration will not read Extended Code 39. If you want to use this symbology, you will probably need to configure the reader. If you need to read both uppercase and lowercase, you should use Code 128.
Code 93 and Exteded Code 93
Code 93 and Extended Code 93 are compressed versions of Code 39 and Extended Code 39. This symbology supports the same characters as Code 39, but in a smaller character width. This is a more difficult symbology to read, and many readers do not support it. Both Code 93 and Extended Code 93 have automatic checksums.
UCC 128
This bar code is a 19-digit, fixed-length bar code that uses Code 128 C to generate the bar code. This bar code is specifically used on shipping containers by those who ship items with UPC codes. UCC 128 has automatic checksums.
Codabar
Codabar bar codes can include numeric characters, six punctuation characters (-$:/.+), and spaces. There are also four special start/stop characters, which are A, B, C, and D. Codabar is useful for encoding dollar figures and mathematical figures. These bar codes are slightly larger than Interleaved 2 of 5 bar codes. Codabar requires start and stop characters. The Codabar symbology is self-checking, but you can use a mod 16 or mod 10 checksum.
EAN/JAN
The EAN/JAN-13 code is used for overseas applications where a country code is required. The UPC-A symbology is actually a subset of the EAN/JAN-13 symbology. This bar code is composed of 2 numbers for the country code, 10 numbers for the data characters, and a checksum. The checksum is generated automatically. The EAN/JAN-8 code is also used for overseas applications where a country code is required. This is similar to the EAN/JAN-13 except that only 5 numbers are used.
MSI
The MSI bar code is used most often in the grocery industry for shelf labels. This is a numeric-only code that stands up well to wear and tear. This code is not self checking, and so a checksum is highly recommended. It supports three types of checksums.
Zip+4 and DPBC POSTNET
This bar code is the special code that is placed on the lower right portion of an envelope. This bar code is used to speed mail through the postal service (by automated sorting) and get reduced rates.
2D (Two-Dimensional) Bar Code Symbologies
A 2D bar code symbology allows vast amounts of data on a single bar code by storing data in 2 dimensions. A common demonstration of the technology is a single bar code no larger than a standard UPC bar code that contains the entire Gettysburg Address. Some common 2D bar code symbologies include PDF 417, DataMatrix Code, and MaxiCode.
For more in-depth information on bar code technology, an excellent reference is The Bar Code Book, by Roger C. Palmer (published by Helmers Publishing, Inc., Peterborough, N.H., 603-924-9631).