Linear, Stacked, 2D: Barcode Types Decoded

Posted January 31, 2012

Everywhere You Look

At this point most everyone knows what a barcode is, right? When I tell people I work for a company that deals with barcodes they pause for maybe a second but then immediately go “Oh yeah, the black and white lines on pretty much everything!” No longer the subjects of suspicion or conspiracies, barcodes have become an indispensible tool for tracking pretty much anything. Look on any retail product and you will find a UPC code. On the back of your driver’s license you’ll find a PDF417. Open up your favorite magazine and you will find QR codes in advertisements taking you to websites and special offers. They literally are everywhere!

Given the wide range of applications to use a barcode more than one type has been developed throughout its history and several dozen are currently in use. Most of us see the bars or gridded boxes and just think ‘barcode’ but depending on what you are tracking and how much information you need it may not be clear what is the best code to go with. We’ll take a look at the 3 types of codes and some of their common uses to help get a better idea of how to get the most out of barcodes.

The picket fence

By far the most immediately recognizable as a barcode, linear codes (also known as 1D codes) are the staple of the Auto-ID industry. Originating from the needs of a local grocery chain to scan item information quickly at check-out, linear codes have become the default means to track items from the warehouse to the retail store and anywhere else. The simplicity of these types of codes is what makes them powerful; a string of numbers or letters usually not exceeding 10-20 digits that can be read by any barcode scanner. With linear codes we are not trying to embed large amounts of information like pricing details or a product name. It is just meant to be a simple ID that we can reference in software for quick recall of useful information like price, descriptions, etc… They are faster than typing and not prone to errors but what are their limitations? As already mentioned, linear codes do have a cap on how big they can be. This is mainly a physical limit since as we add more characters to the code they get wider. Pushing beyond the 20 character range gets you a code that can be 4” or wider. Not really ideal for a bottle of shampoo or an asset label on office items. That said we don’t really need to go this far as we just need an ID to reference in software so 10-15 digits normally covers our bases. Other limitations will come from the type, called symbologies, of linear code we use as each will differ slightly.

The Universal Product Code

The UPC code gets a special notice since it is the strictest in its features due to the fact that it is used throughout all retail chains on a variety of scanners. These limits ensure uniformity where ever the product goes and easy reads for everyone. You get just 12 numeric characters with the UPC and luckily the numbers are managed and issued by the governing body called the GS1 so you don’t have to worry about duplicating anyone else’s numbers. If you are going to sell products into any retail chain this is the code you will have to use.

Code 128 and all the rest

All other linear symbologies are an open field compared to the UPC since we can use them however we please. These barcodes are used within a given business or organization for a specific tracking application so we can define them as needed since we are working in a closed system. We still have some bounds though as Codabar still only uses numeric characters while Code 93 gives you upper case letters and numbers. Likewise, given the same set of characters the different symbologies will take up more or less space so some consideration is needed when choosing one. The all around safest choice would be Code 128 since it is one of the most conservative in size and offers every keyboard character for encoding. Label design software and most scanners can work with all linear symbologies but some lower cost models may not support some of the less common ones like MSI Plessey or Telepen so using Code 128 makes sure that you get the characters you need in a small and easy to read code.

Stacking gets us more

Outside of the traditional linear barcode we do have options for codes that store a lot more data in two dimensions. The first of these is the PDF417 which we call a stacked code due to the fact that it really is like a bunch of linear codes stacked on top of each other.

Now, unfortunately we cannot use a typical laser scanner to read this like linear codes but we can store quite a bit more data, up to 2500 characters. The most common use of stacked codes like PDF417 is on US Driver’s Licenses and tax forms. Everything you see on the front of your license is all embedded into just one code on the back. Most applications don’t need so much data but this can be useful in avoiding counterfeiting as well as provide a redundancy check like the case with licenses. Some businesses have even used all this extra information to their advantage such as scanning a license to populate a credit application to make it easier for customers to apply. One scan and you have a customer’s contact info with no typos!

Into the Matrix

The majority of 2D codes are what we call a matrix based code as they are perfect square grids of equally sized black and white cells. Even beyond the stacked codes, a 2D matrix code can hold thousands of characters in even smaller spaces. As stated before, most applications don’t need such a large amount of information encoded but what the 2D matrix codes really excel at is making things really small. If you where to open up any electronic device you would find Datamatrix codes on the circuit board and even some of the chips!

When we need to just have a 15 digit serial number in less than a ¼” square a 2D matrix code will fit the space and still be easy to read. You often find 2D matrix codes in manufacturing applications but also in the healthcare and automotive industries. Surprisingly, with the prevalence of cameras in cell phones these days the QR Code has been used heavily in advertising due to its ability to encoded links to web pages. With a simple scan from your phone camera you can bring customers to special offers, coupons, or your company website.

With their ability to be read by phones and large data capacity, 2D codes can open up more creative and convenient uses to end users beyond a product code.

So many codes, so many options

With over a dozen symbologies to choose from deciding the best fit barcode for your application may seem daunting at first even though we know now a bit about the different types. The key things to consider when deciding are:

  • How much data do we need to encode?
  • How much space do we have available for the barcode?
  • Where/how will the code be read?

These questions will make it easy to at least determine if we are going linear or stacked/2D matrix with our codes. Linear codes will more often than not be the route to go due to their simplicity and the fact that in most instances we just need to ID something. However, if your application requires something small, very dense, or be read by consumer phones and tablets a stacked/2D code will be the more convenient and useful choice.

Filed under: Tips