Are they usually unique countrywide? Worldwide?
usually the first part of the barcode tells the manufacturer, and the second part tells the SKU (stock keeping unit) the manufacturer’s unique ‘part number’ for the thing being sold.
the grocer’s computer system uses these to reference its own inventory code for the thing and its current price and inventory amount etc.
from Wikipedia for SKU: SKU can also refer to a unique identifier or code, sometimes represented via a barcode for scanning and tracking, which refers to the particular stock keeping unit. These identifiers are not regulated or standardized. When a company receives items from a vendor, it has a choice of maintaining the vendor’s SKU or creating its own.[4] This makes them distinct from Global Trade Item Number (GTIN), which are standard, global tracking units. The Universal Product Code (UPC), European Article Number (EAN), and Australian Product Number (APN) are special cases of GTINs.
Nice answer.
To put this into real-example terms, when you buy something like a box of name-brand cereal, that will have the same barcode everywhere it is sold in the country, because it’s literally printed on the box from the factory, and it is unique by manufacturer so there is no reason to change it.
But when you buy a head of broccoli, the product has come from lots of different farms, and if it has a barcode at all it would be applied by the store themselves when it’s prepared for sale. This means Safeway would probably have a different product code for broccoli than Walmart does, but all Safeway stores would use the same for broccoli as they belong to the same chain.
I’ve seen some produce with a sticker showing PLU and a barcode. Is the barcode in that case just an encoding of the PLU or something grower specific?