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 part of the GS1 system (GS1 US 2018, p. 3). The first and last digits are separated from the others and written in a smaller font size.
The first eleven digits identify the product. In prefix-based allocation, they comprise a company prefix and an item reference whose lengths vary but total eleven digits (GS1 US 2018, p. 11). The last digit is a check digit obtained from
|
(1)
|
where (mod 10) indicates taking the remainder after dividing by 10. For example, the UPC for Tropicana Pure Premium orange juice is
|
(2)
|
where the check digit is
|
(3)
| |||
|
(4)
| |||
|
(5)
| |||
|
(6)
|
as expected.