Friday 22 February 2013

How to Read 12 Digit UPC Barcodes

Most bar codes in the US are 12-digit UPC (Universal Product Code) bar codes, with ten digits at the bottom of the code and one small number to each side. Impress your friends by asking them to select a random item from the kitchen with a removable label and cut the numbers off of the UPC bar code; you can then proceed to read the numbers encoded in the lines.

Note that bar codes are made up of both white and black lines. The white spaces in between the black lines are part of the code.


  Understand that there are four different thicknesses to the lines. Henceforth, the skinniest line will be referred to as "1," the medium-sized line as "2," the next largest line as "3." and the thickest is "4."



Recognize that each UPC bar code begins and ends with 101 (thin black, thin white, thin black). In the very middle of the bar code, you will notice two thin black lines sticking down between the numbers. The thin white between them, as well as the thin whites to either side, make up a 01010. Each UPC bar code has 01010 in the middle.
Recognize that each digit, including the small numbers that begin and end the bar code, has its own unique four-line set. 0 = 3211, 1 = 2221, 2 = 2122, 3 = 1411, 4 = 1132, 5 = 1231, 6 = 1114, 7 = 1312, 8 = 1213, 9 = 3112. (Note that the sum of bar widths numbers is 7 for all codes because each code is 7 units wide.) Notice that the line colors are reversed after the center-line: The lines of the digits to the left are white/black/white/black whilst to the right they are black/white/black/white. This provides some error checking and allows the reader to know the direction in which it is scanning a code. It is also crucial so that the bar code ends with a bar rather than a space. So, actually, each digit has two codes.



So, the bar code above whose first two digits are 03 would start out "10132111411". Broken down this is "101-3211-1411" where 101 marks the beginning of the bar code and 3211 marks the digit 0 .


No comments:

Post a Comment