Are they usually unique countrywide? Worldwide?
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?