Open the app

Barcode on packaging: what is encrypted in it and what is not

Close-up of a barcode on product packaging: black bars and a row of numbers underneath, shot at an angle on a light-colored table

There is a persistent belief about barcodes: that you can supposedly tell the country where a product was made from the first digits, and verify its authenticity from the rest. Neither is true. It is useful to understand what is actually there, because this code serves as the key to everything that the application will later tell you about the product.

The code is a key, not a description

The thirteen digits of an EAN-13 code do not store information about ingredients, nutritional value, shelf life, or weight. They store a number—a unique identifier for a product item. Everything else resides in a database for which this number serves as a key.

This leads to a conclusion that explains half of the misunderstandings: a scanner that "did not recognize the product" read the code perfectly fine. It simply did not find a record. These are different issues, and they are addressed in different ways—databases and their gaps are a separate topic covered in our article on product databases.

How the thirteen digits are organized

The code structure is as follows:

PartMeaning
First 2–3 digitsPrefix of the GS1 organization that issued the number
Next 4–7 digitsEnterprise number within that organization
Up to the 12th digitProduct item number, assigned by the manufacturer
13th digitCheck digit

The boundaries between the second and third parts are variable: an enterprise that produces many items receives a short number and a long remainder for products, while a small one receives the opposite. You cannot determine where the boundary lies just by looking at the code itself.

The check digit can be verified mentally. The digits from the first to the twelfth are multiplied alternately by 1 and 3, the products are summed, and the result is rounded up to the nearest multiple of ten—this is the thirteenth digit. This check catches typos during manual entry and scanning errors. It says nothing about the authenticity of the product: the check digit will match for both a genuine package and one printed by anyone.

The first digits do not indicate the country of origin

A prefix of 460–469 means the number was issued by a Russian GS1 organization, while 400–440 means it was issued by a German one. This means exactly one thing: where the enterprise joined the numbering system. The prefix does not indicate where the product was physically made, what it is made of, or where it went afterward.

A common situation: a Russian company orders production abroad and marks the product with its own code using the 46 prefix; a European holding company with a Russian facility uses its European prefix. Both options are legal, and both debunk the myth about "the country based on the first digits."

The country of origin should be written in words, and this is a labeling requirement, not a coding one: technical regulation TR TS 022/2011 lists the mandatory information that must appear on the packaging in text form. Reading this is the subject of our article on reading ingredients on labels.

EAN-13 relatives found on store shelves

Why the code is on the package but the product is not in the app

There are several reasons, and they are all quite prosaic.

The records were simply not created. Open databases are populated by participants and users; the Russian market is poorly covered in them, especially private-label products from retail chains. The code is real, but there is no page for it.

The item changed its number. When changing weight, flavor, or recipe, the manufacturer is required to issue a new product item number. The old code remains in the database, but the new one is not added—so the fresh package is not found, while last year's was.

The code is internal. Prefixes 20–29 are reserved for internal use by retail outlets: bulk goods weighed at the checkout, house-made salads. Such a code usually contains the price or weight, it is valid only within that specific chain, and there is no global database behind it.

The code did not scan. Glare on glossy surfaces, crumpled film on the packaging, or the camera being too close. This is exactly the case where simply retaking the photo is enough.

When a record is not found, the only option is to read what is printed in words: the nutritional value on the pack is the manufacturer's claim, and why it might differ from the actual contents is discussed separately.

What the barcode does not verify

It does not detect counterfeits: the code is printed along with the label, and copying it is no harder than copying the label itself. Quality, freshness, and the legality of a batch are not encoded in the thirteen digits—there is no date or batch number, as there is simply no room for them in the format. The task of tracking a specific item is solved by other formats: they have a larger payload and a government registry behind them.

Count it from a photo

Frequently asked questions

Can you determine the country of origin from a barcode?
No. The first digits indicate the GS1 organization that issued the number, meaning the country where the company joined the numbering system. However, the product itself can be manufactured anywhere. The country of origin should be indicated on the packaging in words.
Does the barcode contain information about ingredients and calories?
No. The thirteen digits are a unique item number, a key to a database record. Ingredients, nutritional value, and expiration dates are stored separately, and if there is no record, scanning will yield nothing, even if the code is read correctly.
How can I verify that a barcode is authentic?
You can only verify the check digit: the first twelve digits are multiplied alternately by 1 and 3, and the sum is rounded up to the nearest multiple of ten. This catches typos, but not counterfeits—a copied label will also have a correct check digit.
Why can't a new package be found, while the old one could?
When the weight, flavor, or recipe changes, the manufacturer assigns a new number to the product. The old record remains in the database, while the new one has not yet been added. This is the most common reason why a familiar product suddenly stops being recognized.
What are the codes starting with 20–29?
These are internal store codes: bulk items weighed at the checkout, or ready-to-eat food produced in-house. They usually contain the price or weight, are valid only within that specific retail chain, and do not exist in general databases.

Read next

This article is for general information. It is not medical advice, a diagnosis, or a prescription for treatment or a diet, and it does not replace a consultation with your doctor. If you have a health condition, are pregnant, take medication, or follow a diet prescribed to you, decisions about food belong with your doctor.

Figures from regulations, guidelines and studies are given as they stood when this article was prepared and may since have changed; check them against the primary sources. This article is not advertising, an offer, or individual advice, and neither the author nor the site owner is responsible for decisions taken on the basis of it.