The Datamatrix barcode is great for industrial applications. It is robust, easy to print and can contain a lot of data in a small space. It can also be read using just about any 2D imaging barcode scanner – including smartphones.
One question that comes up from time to time is exactly how much data can be encoded into a given size of Datamatrix? Before going too far, lets have a quick look at how the Datamatrix code is constructed.
As you can see in the example, the Datamatrix code has two sides that are solid black and two sides that are alternatively black and white. This pattern tells the scanner that is reading the code which orientation the code is in and allows it to read the data which is encoded in the square elements inside the matrix.
Usually when I create a Datamatrix code in BarTender, I just keep with the default setting of “Auto Square”. BarTender then creates the code using the smallest matrix to be able to include the data I need.
In this case, to encode the characters 1 through 8, it has used a 12 x 12 matrix.
As one would expect, as more data is encoded, the size of the matrix needed grows as well. Just as an aside, if you are printing Datamatrix codes for a series of labels, it always a good practice to check that the barcode can encode the largest amount of data you need without growing to be too big and overlapping other elements on your label.
Every now and again, a customer will specify a particular size of Datamatrix for a label and we have to get the data to fit within that. A case this week proved to be rather interesting (and got me thinking about writing this post).
The client’s specification called for a Datamatrix of 8 x 18 elements and the data to be of the format NNNNNN-AAA (where N= numbers and A = letters).
No problem with making the 8 x 18 Datamatrix – BarTender allows me to choose a lot of different matrix sizes including this one. However, when I go to encode the data, I get an error; there is too much data to fit into that size matrix. This got me wondering as to what is the data capacity of any given Datamatrix size?
Thanks to my good friend Dr. Google, I quickly found this table (from jpgraph.net):
This gives the data capacity of various sizes of Datamatrix code, for numeric, alphanumeric and binary data. Very helpful, I’d say! Our friends at Microscan also have a cool size/data capacity comparison chart – check it out here.
Is the table accurate? I wondered. Testing some of the sizes in BarTender it seems that it is indeed accurate.
For our client’s application with the 8 x 18 matrix, the table tells me that the data capacity is 10 numeric characters or 6 alphanumeric (BarTender agrees) which is why it is not possible to encode the requested 10 alphanumeric characters. To encode the client’s data, they would have to step up to an 8 x 32 matrix size.
Datamatrix codes are often touted as being a great way to encode a lot of data in a small space. While this is obviously perfectly true, there are limits to this that just might need to be taken into account.
Have you come across any of these Datamatrix capacity restrictions? How did you get around it?