The universal product code (UPC) is a 12-digit number and associated machine-readable bar code used to identify products being purchased in grocery stores. UPCs encode an individual product, but not its price (this part is done by a store's computer after reading the product identifier). The UPC is maintained by the Uniform Code Council of Dayton, Ohio. The first and last digits are separated from the others and written in a smaller font size.

The first six digits are a manufacturer identifier, and the next five digits identify a specific product. The last digit is a check digit obtained from

 a_(12)=10-[(3sum_(i=1; i odd)^(11)a_i+sum_(i=2; i even)^(10)a_i) (mod 10)] (mod 10),

where (mod 10) indicates taking the remainder after dividing by 10. For example, the UPC for Tropicana Pure Premium orange juice is

 0 48500 00102 8

where the check digit is

a_(12)=10-{[3(0+8+0+0+1+2)+(4+5+0+0+0)] (mod 10)} (mod 10)
=10-[42 (mod 10)] (mod 10)
=10-2 (mod 10)

as expected.

See also

Checksum, Coding Theory, ISBN

Explore with Wolfram|Alpha


More things to try:

Cite this as:

Weisstein, Eric W. "UPC." From MathWorld--A Wolfram Web Resource.

Subject classifications