For the 13 digit code:
Digits 1 & 2 indicate the country where the code was issued, e.g. "50" for UK.
(not necessarily the country where the product was manufactured)
Digits 3 - 7 indicate the company who produced the product.
Digits 8 -12 indicate the product and size, e.g. "02467" to indicate 415g Baked Beans in Tomato Sauce
Digit 13 is a computer check digit that can be used to confirm that the make up of the whole code is correct.
The 8 digit code is used for small labels where space is not available for the 13 digit code:
Digits 1 & 2 indicate the country where the code was issued, e.g. 50 for UK.
Digits 3 - 5 indicate the company who produced the product.
Digits 6 & 7 indicate the product and size
Digit 8 is a computer check digit
This system of numbering ensures that every product sold has a different number and barcodes can be read by scanning equipment in supermarkets (Electronic Point of Sale or EPOS). The barcode does not identify the price of the product; prices are stored in a computer linked to the barcode scanning equipment.