There are quite a few different types of barcode encoding schemes in use around the world. The different schemes are known as symbologies. Each one has its own strengths and weaknesses, which make it more or less suitable for a given application. Some of the characteristics that get traded off in choosing (or designing) a barcode symbology are:
- Density How much room do you have for your barcode? This is a key aspect of barcode design. It is the one that every other design choice must make deals with. There are many strategies for increasing the density of barcode symbologies, most of which are beyond the scope of this writeup.
- Character Sets How many different characters do you need? Some symbologies can encode only numbers, some can encode the entire extended ASCII set, others fall somewhere in between.
- Integrity How important is accuracy? Symbologies may (or may not) use a couple of different means of encouraging accuracy:
- Self-checking symbologies are those in which a single error will always produce an invalid character. The barcode will just be rejected by the scanner. This is distinct from:
- Checksums are extra character(s) added to the encoded content, based on some mathematical operation performed on it. This is especially useful when the code may be hand-entered, for instance when self-checking rejects a corrupt or damaged barcode.
- Simplicity How much trouble and expense are you willing to invest? Some symbologies can be nothing more than special fonts, which may be typed in with a word processor. Others may require special software and hardware to use.
The following is a list of some of the more popular barcode symbologies in use at the turn of the 21st century. It is by no means exhaustive, but it illustrates some of the tradeoffs inherent in the technology.
- Code 39, or "3 of 9" This is the most common general-purpose symbology. It is simple, self-checking, and it can encode alphabetic, as well as numeric characters. There are variations of it that can incorporate checksums, and lowercase letters and extra symbols. There are freeware 3 of 9 fonts, and any off-the-shelf scanning system can read it. It is used in warehouse tracking, or just about any place where barcodes are handy for internal purposes. It is not at all compact, but it is very flexible.
- UPC "Universal Product Code". There are actually five variants. The most familiar to American and Canadian consumers is UPC-A. It is the 12 digit numeric code on every candy bar and can of beans in North America. From a design standpoint, its most important characteristic is integrity. It can be scanned omnidirectionally, and is very forgiving of print quality. Both the symbology and its content are overseen by the Uniform Code Council, Inc. (UCC), of Dayton, Ohio. If you want to sell your product in Wal-Mart, you gotta go through the UCC first.
- EAN "European Article Numbering". These symbologies are a superset of UPC, with thirteen digits instead of twelve. They incorporate a country code along with the UPC information. EAN International has offices around the world, and even the UCC will require retailers to use EAN codes by 2005. For some reason, Japan has adopted its own name for the EAN-13 symbology, with its country code. If you see references to a JAN barcode, do not be alarmed. Your EAN-13 system will work fine.
- Postnet The US Postal Service has invented its own unique barcode system for mail. It uses the height of the bars, instead of their width, to encode information. This system is well-adapted to streaming readers. Traditional symbologies would be susceptible to errors introduced by fluctuations in the speed at which a barcode passed in front of the reader.
- MSI Also known as Modified Plessey Code. These are the barcodes seen on the shelves (but not on the products) in grocery stores. It is not self-checking, but it uses a CRC check code. It has a hexadecimal character set. It is very well-suited to reading and mass code storage by portable devices. (Maybe you have seen people with little boxes slung over their shoulders, working their way down the aisles.) The original Plessey Code is almost obsolete, but it is sometimes still used in libraries.
- Code 128 Unlike Code 39, Code 128 incorporates the entire 128 character true ASCII set. It uses a check code, and is extremely dense. It has no set length, so you can use it for just about any old thing. This is a good one to use if you need to encode lots of information per item. Unfortunately, you can't just type this one in. You'll need some software to create and read these barcodes. There is also a UCC/EAN-128 specifation, which is used to provide product supply chains with extended information.
- 2 of 5 "plain" 2 of 5 is not used as often as Interleaved 2 of 5. This is a numeric-only symbology that encodes numbers in pairs - odd-numbered digits in the bars, even-numbered ones in the spaces. Its chief virtue is density.
- Two-Dimensional Barcodes There is a whole class of "barcodes" that are non-linear. You have probably seen these on the shipping labels of UPS packages. That one is called Maxicode, and it can store up to 100 full ASCII characters in a square inch. It can still be read when 25% of it has been destroyed. Other prevalent 2-d barcodes are Codablock and PDF417. One of the best is called SuperCode, and it has been graciously released to the public domain by its inventor, Ynjiun Wang. These are certainly the future of barcoding, because of their density and integrity, but they all require special software and hardware to implement.