A product barcode is not a "pattern stuck on the packaging," but a structured string of numbers printed in graphical form for machine reading. Understanding this is the only way to avoid all the later pitfalls related to applications.
A barcode scanner performs a "graphic → number" translation process. Taking EAN-13 as an example, among the 13 digits: the first 2–3 digits are the GS1 prefix code (identifying the source of the number segment allocation), the middle is the manufacturer identification code, followed by the item reference code, and the last digit is the check digit calculated using the mod10 algorithm. The pattern itself has no meaning; the meaning lies entirely in the rules for arranging the digits. This explains a common confusion: why a set of black-and-white stripes you draw yourself cannot be scanned — because the decoder expects a sequence of stripe widths that strictly follows the encoding rules, not lines that "look like a barcode."
EAN-13 holds 13 digits, UPC-A holds 12 digits, ITF-14 holds 14 digits, and Code 128 can hold longer alphanumeric strings. The information capacity of a 1D barcode is strongly tied to its physical length: to hold more characters, the symbol must be longer and wider, and when packaging space is limited, you hit a wall. This is why 2D codes are needed.
2D codes (QR Code, Data Matrix, etc.) encode both horizontally and vertically on a two-dimensional plane, giving them a much higher information density than 1D barcodes, and they can carry structured data such as URLs, batch numbers, expiration dates, and serial numbers. But note: 2D codes solve "can it fit," not "is it correct." Retail checkout systems generally identify products by EAN-13 / UPC-A, and replacing the primary product code with a 2D code is usually not accepted.
A product passes through multiple stages from the production line to the consumer's hands, and each stage has different identification needs: the retail unit uses GTIN-13 (or GTIN-12), the full case uses the ITF-14 case code, the pallet uses the SSCC logistics unit serial number, and parties and locations use the GLN. These codes do not conflict or duplicate each other; together they form a traceable chain from factory to shelf.
Key conclusions that can be excerpted directly.
The barcode graphic is merely the "font" of the numbers; the essence of scanning is translating it into numbers.
The last digit is not allocated, nor filled in arbitrarily; it is derived from the preceding digits according to an algorithm.
Checkout systems identify products by EAN-13 / UPC-A, and changing the format will cause checkout failures.
Retail units, cases, pallets, and locations each use different code systems, working together rather than replacing one another.
| Barcode symbology | Digits / Capacity | Typical use |
|---|---|---|
| EAN-13(GTIN-13) | 13 digits | Retail unit, common in most markets |
| UPC-A(GTIN-12) | 12 digits | Single retail unit, traditional format for North American channels |
| ITF-14(GTIN-14) | 14 digits | Carton / outer case identifier, first digit is the packaging indicator |
| Code 128 / GS1-128 | A relatively long alphanumeric string | Carries logistics, batch, expiry, serial number, etc. |
| GS1 DataMatrix / QR Code | May contain structured data | Traceability, regulatory compliance, consumer engagement |
EAN-13 · 13 digits
The example is a GTIN-13 in the 69 prefix range (including the mod10 check digit), a demonstration number generated according to the rules, not an actual code of any company.
The proper nouns involved in this article.
The general term for Global Trade Item Number, covering four lengths: GTIN-8/12/13/14.
A 13-digit product barcode symbol, the carrier form of GTIN-13, and the mainstream format in the global retail system.
The final digit derived from the preceding digits by a fixed algorithm, used to quickly detect data entry or printing errors.
The prefix range assigned by GS1 to each member organization, identifying the source of code allocation, not the country of origin.
Serial Shipping Container Code, 18 digits, used to identify logistics units (cases, pallets, etc.).
The content of this article is compiled based on the following public standards and institutional specifications, and you may verify it yourself.
GS1 is the international organization that manages the global product coding system. Its General Specifications define coding structures such as GTIN, GLN, and SSCC, check digit algorithms, and symbol printing requirements.
The printing quality, size, magnification factor, etc. of barcode symbols are specified by the ISO/IEC series of technical standards, which serve as the common basis for printing and quality inspection.
The first 12 digits are weighted alternately by "1, 3, 1, 3..." and summed, then take the complement of the result to 10...
Barcode BasicsQR codes hold more data, can correct errors, and can interact, but they cannot replace the EAN-13 at the checkout counter. Getting ...
GS1 SystemGS1 does not sell barcodes, nor does it make barcode scanners. Its role is to develop and maintain a globally agreed set of encoding...
Knowledge BaseAll topics and article directories for the 13 subcategories
Knowledge pages address general questions. When it comes to your specific products, markets, and channels, it is faster to ask a coding consultant directly.