Bar codes, the most common of which is the Universal Product Codes (UPCs), are images printed on products for sale that can be read and interpreted by a laser bar code reader, which in turn converts the bar coded information to a sequence of numbers that can be used to identify individual products in a database. The images printed are a sequence of black and white bars that represent different numbers. Converting bar codes to digits is a straightforward process.
Things You'll Need
- Example bar code
- Table of bar codes
Obtain a bar code example. Look on a bag or box for a product that has been purchased in a grocery store. The UPC code is either stamped or printed onto paper or plastic and is usually nearly square shaped. The code will be comprised of alternating black and white bars, generally with a regular number stamped below them.
Create a bar code transposition table. Draw a rectangular box on a piece of paper with three columns and 10 rows. Label the columns from left to right as such: Number, Left, Right. The transposition table will be comprised of all the possible sequences in the code for the numbers available for a particular code. For the UPC, there are no letters or other symbols, which leaves just the digits 0 through 9 (see "Tips" for more chart information).
Read your example bar chart from left to right. Skip the first two black bars as they are just placeholders. Count over across the next seven bars, including the white ones. Those seven bars represent the first number. Write down a 1 for a black bar and a 0 for a white one. You should end up with a number such as: 0110111.
Look for that sequence of bars in the table you made. The number corresponding to it is the first number your write down in your transcription. If it was 0110111, for example, you’d write down 8.
Continue reading the barcode from left to right, counting the next seven bars. That’s your next number. Use your table to convert it to a number as well. Continue in this manner until you have six numbers written down.
Skip the 0101 pattern of bars in the middle of the bar code as they are only placeholders.
Continue with the next six numbers as you did the first six, writing down each number as you go. You should wind up with a 12 digit number that has been converted from its bar code format.