10176

# UPC Bar Code

The 12-digit universal product code (UPC) is in widespread use on items for sale in the United States and many other countries. This Demonstration is designed to illustrate how the UPC number is encoded into the familiar looking bars seen on packaging. When the "show details" option is selected, guide lines appear. These guide lines show that each digit in the UPC number is represented by a sequence of seven bars. The bar code begins and ends with a 3-bar "guard bars" pattern and the bar code is separated into two parts by the 5-digit "center bars". Moving the cursor over the UPC number will show what the various parts of the number represent, and moving the cursor over the individual digits/spaces above the bar code will show a large graphic of the coding of those symbols.

### DETAILS

The code for a digit depends on whether the digit appears before or after the center bars. The two codes for a digit are complements of each other (1's become 0's, 0's become ones; see snapshot 1). Several of the fixed examples are designed to allow easy comparison of the bars corresponding to certain digits before and after the space bars. See snapshots 2–4.
The last digit is the check digit. While the check digit does not always appear on the printed UPC code on a product, the bars for the check digit are always there. Given a UPC number , the check digit is chosen so that the weighted sum is divisible by 10.
Reference
[1] COMAP, For All Practical Purposes, New York: W. H. Freeman and Company, 2009.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.