Recent from talks
Nothing was collected or created yet.
International Article Number
View on Wikipedia
International Article Number, also known as European Article Number (EAN), is a global standard that defines a barcode format and a unique numbering system used in retail and trade. It helps identify specific types of retail products based on their packaging and manufacturer, making it easier to track and manage products in international trade.
Originally developed to simplify product identification in stores, the EAN system has been integrated into the broader Global Trade Item Number (GTIN) standard. While GTIN can be expressed with any barcode format, the EAN barcode format remains the most widely recognized one used in inventory control, wholesale transactions, and accounting processes.
The most widely used version is EAN-13, an extension of the earlier 12-digit Universal Product Code (UPC-A) with an optional numeric prefix indicating the country of registration. In cases where space is limited on packaging, the shorter EAN-8 format is used. To append supplemental information, such as periodical issue numbers and food item prices, EAN-2 and EAN-5 are also used.
Composition
[edit]The 13-digit EAN-13 number consists of four components:[1]
- GS1 prefix – 3 digits [2]
- Manufacturer code – variable length
- Product code – variable length
- Check digit
GS1 prefix
[edit]The first three digits of the EAN-13 (GS1 Prefix) usually identify the GS1 Member Organization which the manufacturer has joined (not necessarily where the product is actually made).[3] Note that EAN-13 codes beginning with 0 are actually 12-digit UPC codes with prepended 0 digit. In recent years,[when?] more products sold by retailers outside the United States and Canada have been using EAN-13 codes beginning with 0, since they were generated by GS1-US.
The 020-029 GS1 Prefixes are worth a special mention. GS1 defines this as being available for retailer internal use (or internal use by other types of business). Some retailers use this for proprietary (own brand or unbranded) products, although many retailers obtain their own manufacturer's code for their own brands. Other retailers use at least part of this prefix for products which are packaged in store, for example, items weighed and served over a counter for a customer. In these cases, the barcode may encode a price, quantity or weight along with a product identifier – in a retailer defined way. The product identifier may be one assigned by the Produce Electronic Identification Board (PEIB) or may be retailer assigned. Retailers who have historically used UPC barcodes tend to use GS1 prefixes starting with "02" for store-packaged products.[citation needed]
The EAN "country code" 978 (and later 979) has been allocated since the 1980s to reserve a Unique Country Code (UCC) prefix for EAN identifiers of published books, regardless of country of origin, so that the EAN space can catalog books by ISBNs[4] rather than maintaining a redundant parallel numbering system. This is informally known as "Bookland". The prefix 979 with first digit 0 is used for International Standard Music Number (ISMN) and the prefix 977 indicates International Standard Serial Number (ISSN).
Manufacturer code
[edit]The manufacturer code is a unique code assigned to each manufacturer by the numbering authority indicated by the GS1 Prefix. All products produced by a given company will use the same manufacturer code. EAN-13 uses what are called "variable-length manufacturer codes". Assigning fixed-length 5-digit manufacturer codes, as the UCC has done until recently, means that each manufacturer can have up to 99,999 product codes.(9,999 for 3 digit GS1 prefix's) Many manufacturers do not have that many products, which means hundreds or even thousands of potential product codes are being wasted on manufacturers that only have a few products. Thus if a potential manufacturer knows that it is only going to produce a few products, EAN-13 may issue it a longer manufacturer code, leaving less space for the product code. This results in more efficient use of the available manufacturer and product codes.[5]
In ISBN and ISSN, this component is used to identify the language in which the publication was issued and managed by a transnational agency covering several countries, or to identify the country where the legal deposits are made by a publisher registered with a national agency, and it is further subdivided any allocating subblocks for publishers; many countries have several prefixes allocated in the ISSN and ISBN registries.
Product code
[edit]The product code is assigned by the manufacturer. The product code immediately follows manufacturer code. The total length of manufacturer code plus product code should be 9 or 10 digits depending on the length of country code (2–3 digits).
In ISBN, ISMN and ISSN, it uniquely identifies the publication from the same publisher; it should be used and allocated by the registered publisher in order to avoid creating gaps; however it happens that a registered book or serial never gets published and sold.
Check digit
[edit]The check digit is an additional digit, used to verify that a barcode has been scanned correctly. It is computed modulo 10, where the weights in the checksum calculation alternate 3 and 1. In particular, since the weights are relatively prime to 10, the EAN-13 system will detect all single digit errors. It also recognizes 90% of transposition errors (all cases, where the difference between adjacent digits is not 5).
Calculation of checksum digit
[edit]The checksum is calculated as sum of products – taking an alternating weight value (3 or 1) times the value of each data digit. The checksum digit is the digit which must be added to this checksum to get a number divisible by 10 (i.e. the additive inverse of the checksum, modulo 10).[6] See ISBN-13 check digit calculation for a more extensive description and algorithm. The Global Location Number (GLN) also uses the same method.
Position – weight
[edit]The weight at a specific position in the EAN code is alternating (3 or 1) in a way, that the final data digit has a weight of 3 (and thus the check digit has a weight of 1).
All Global Trade Item Number (GTIN) and Serial Shipping Container Code (SSCC) codes meet the next rule:
Numbering the positions from the right (code aligned to the right), the odd data digits are always weight of 3 and the even data digits are always weight of 1, regardless of the length of the code.
Weights for 18-digit SSCC code and GTINs (GTIN-8, GTIN-12, GTIN-13, GTIN-14):
| position | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| weight | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
Weights for EAN-13 code:
| position | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
Weights for EAN-8 code:
| position | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| weight | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
Calculation examples
[edit]- For EAN-13 barcode 400638133393x, where x is the unknown check digit, (Stabilo Point 88 Art. No. 88/57), the check digit calculation is:
position 12 11 10 9 8 7 6 5 4 3 2 1 first 12 digits of barcode 4 0 0 6 3 8 1 3 3 3 9 3 weight 1 3 1 3 1 3 1 3 1 3 1 3 partial sum 4 0 0 18 3 24 1 9 3 9 9 9 checksum 89
- The nearest multiple of 10 that is equal to or higher than the checksum, is 90. Subtract them: 90 - 89 = 1, which is the check digit x of the barcode.
- For EAN-8 barcode 7351353x, where x is the unknown check digit, the check digit calculation is:
position 7 6 5 4 3 2 1 first 7 digits of barcode 7 3 5 1 3 5 3 weight 3 1 3 1 3 1 3 partial sum 21 3 15 1 9 5 9 checksum 63
- The nearest multiple of 10 that is equal to or higher than the checksum, is 70. Subtract them: 70 - 63 = 7, which is the check digit x of the barcode.
Binary encoding of data digits into EAN-13 barcode
[edit]The GTIN numbers, encoded to UPC-A, EAN-8 and EAN-13, all use similar encoding. The encoded data is usually repeated in plain text below the barcode.
Barcode structure
[edit]



The barcode consists of 95 areas (also called modules[citation needed]) of equal width. Each area can be either white (represented here as 0) or black (represented as 1). From left to right:
- 3 areas for the start marker (101)
- 42 areas (seven per digit) to encode digits 2–7, and to encode digit 1 indirectly, as described in the following section
- 5 areas for the center marker (01010)
- 42 areas (seven per digit) to encode digits 8–13
- 3 areas for the end marker (101)
Encoding of the digits
[edit]To encode the 13-digit EAN-13 number, the digits are split into 3 groups; the first digit, the first group of 6 and the last group of 6. The first group of 6 is encoded using a pattern whereby each digit has two possible encodings, one of which has even parity (denoted with letter G) and one of which has odd parity (denoted with letter L). The first digit is not represented directly by a pattern of bars and spaces, but is encoded indirectly, by selecting a pattern of choices between these two encodings for the first group of 6 digits, according to the table below. All digits in the last group of 6 digits are encoded using a single pattern RRRRRR, the one also used for UPC.
If the first digit is zero, all digits in the first group of 6 are encoded using the pattern LLLLLL used for UPC; therefore, a UPC barcode is also an EAN-13 barcode with the first digit set to zero.
| First digit | First group of 6 digits | Last group of 6 digits |
|---|---|---|
0 |
LLLLLL |
RRRRRR
|
1 |
LLGLGG |
RRRRRR
|
2 |
LLGGLG |
RRRRRR
|
3 |
LLGGGL |
RRRRRR
|
4 |
LGLLGG |
RRRRRR
|
5 |
LGGLLG |
RRRRRR
|
6 |
LGGGLL |
RRRRRR
|
7 |
LGLGLG |
RRRRRR
|
8 |
LGLGGL |
RRRRRR
|
9 |
LGGLGL |
RRRRRR
|
This encoding guarantees that the first group always starts with an L-code, which has odd parity, and that the second group always starts with an R-code, which has even parity. Thus, it does not matter whether the barcode is scanned from the left or from the right, as the scanning software can use this parity to identify the start and end of the code.
EAN-8 barcodes encode all digits directly, using this scheme:
| First group of 4 digits | Last group of 4 digits |
|---|---|
LLLL |
RRRR
|
| Digit | L-code | G-code | R-code |
|---|---|---|---|
0 |
0001101 |
0100111 |
1110010
|
1 |
0011001 |
0110011 |
1100110
|
2 |
0010011 |
0011011 |
1101100
|
3 |
0111101 |
0100001 |
1000010
|
4 |
0100011 |
0011101 |
1011100
|
5 |
0110001 |
0111001 |
1001110
|
6 |
0101111 |
0000101 |
1010000
|
7 |
0111011 |
0010001 |
1000100
|
8 |
0110111 |
0001001 |
1001000
|
9 |
0001011 |
0010111 |
1110100
|
Note: Entries in the R-column are bitwise complements (logical operator: negation) of the respective entries in the L-column. Entries in the G-column are the entries in the R-column in reverse bit order. See pictures of all codes against a colored background.
A run of one or more black areas is known as a "bar", and a run of one or more white areas is known as a "space". As can be seen in the table, each digit's encoding comprises two bars and two spaces, and the maximum width of a bar or space is four areas.
EAN-13 barcode example
[edit]
- C1, C3: Start/end marker.
- C2: Marker for the center of the barcode.
- 6 digits in the left group: 003994.
- 6 digits in the right group (the last digit is the check digit): 155486.
- A digit is encoded in seven areas, by two black bars and two white spaces. Each black bar or white space can have a width between 1 and 4 areas.
- Parity for the digits from left and right group: OEOOEE EEEEEE (O = Odd parity, E = Even parity).
- The first digit in the EAN code: the combination of parities of the digits in the left group indirectly encodes the first digit 4.
The complete EAN-13 code is thus: 4 003994 155486.

Decoding
[edit]By utilizing the barcode's center marker, a scanner can decode an International Article Number (EAN) by scanning one half of the barcode at a time through a helical scan at a 45-degree angle. This method reconstructs the full code from partial scans, useful when the barcode is obscured or damaged. Error detection algorithms, such as checksum verification, play a crucial role by identifying and correcting scanning errors, ensuring accurate decoding. Additionally, modern scanners often employ omnidirectional scanning, enhancing their ability to read barcodes at various angles.
These scanners also leverage the symmetrical structure of EAN-13, allowing decoding from either direction. Error detection algorithms, like the Luhn algorithm, commonly used in checksum calculations, verify the integrity of the data scanned. If errors are detected, the scanner can either alert the user or attempt correction, improving the reliability of scanning in dynamic or less-than-ideal conditions.
Japanese Article Number
[edit]Japanese Article Number (JAN) is a barcode standard compatible with the EAN. It is a subset of EAN. Use of the JAN standard began in 1978. Originally, JAN was issued a flag code (EAN's number system) of 49. In 1992, JAN was newly issued an additional flag code of 45. In January 2001 the manufacturer code changed to 7 digits (9 digits including the flag code) for new companies.[7]
See also
[edit]- EAN-8, another EAN standard
- EAN-5, a supplement for the suggested list price
- EAN-2, a supplement to indicate an issue number
- Electronic Data Interchange
- European Article Numbering-Uniform Code Council
- Global Electronic Party Information Register (GEPIR) a searchable distributed database of GS1 GTINs
- GTIN
References
[edit]- ^ "European Article Number: Was das ist und wie man sie beantragt" (in German). 30 September 2019. Archived from the original on 17 December 2019. Retrieved 17 December 2019.
- ^ GS1 India (2021-06-07). "EAN 13 – The Barcode Number". Archived from the original on 2021-06-27. Retrieved 2021-06-27.
The first three digits of the EAN-13 serve as the GS1 Prefix
{{cite web}}: CS1 maint: numeric names: authors list (link) - ^ Prefix List, GS1, archived from the original on 2014-12-28, retrieved 2010-09-25.
- ^ "Barcodes for Books". Archived from the original on 2013-01-02. Retrieved 2012-12-20.
- ^ "EAN-13 Symbology". www.barcodeisland.com. Archived from the original on 2016-01-14. Retrieved 2016-05-01.
- ^ Check Digit Calculator Archived 2016-11-21 at the Wayback Machine, at GS1 US.
- ^ "Bar Code Guide – Barcode Types – JAN". Archived from the original on 2013-01-27. Retrieved 2016-05-02.
External links
[edit]- OpenFoodFacts, a free and collaborative database of products with EAN codes
- Global Electronic Party Information Registry (GEPIR)
- upcdatabase, another online barcode database Archived 2020-11-09 at the Wayback Machine
- George J. Laurer's explanation for running his Authenticated Number Registration Directory, Archived 2016-11-25 at the Wayback Machine
- EAN-Search, subscription based barcode database with API, over 275 million entries
- Official JAN homepage (in Japanese)
International Article Number
View on GrokipediaOverview
Definition and Purpose
The International Article Number (EAN), also known as the European Article Number in its original form, is a standardized 13-digit numeric barcode symbology designed for the unique identification of trade items, such as consumer products, in global commerce.[2] It encodes a Global Trade Item Number (GTIN-13) and is represented as a linear barcode that can be scanned by optical readers.[7] An 8-digit variant, EAN-8, exists for smaller packages where space is limited, maintaining the same principles of identification.[8] Now managed internationally by GS1, the system ensures consistent product numbering across supply chains, independent of manufacturers or retailers.[9] The primary purpose of the EAN is to enable automated identification and data exchange in retail, logistics, and inventory management, allowing seamless tracking of goods from production to point-of-sale.[9] By providing a universal identifier, it supports interoperability among diverse systems, facilitating efficient scanning and information sharing worldwide without reliance on proprietary codes.[1] This standardization is essential for global trade, where products move across borders and require consistent recognition by scanners and databases.[9] Key benefits include reduced errors at checkout through precise product lookup, enhanced supply chain efficiency via accurate inventory control, and smooth integration with point-of-sale (POS) systems that automate transactions and pricing.[7] For example, in retail environments, EAN scanning minimizes manual entry mistakes, speeding up processes and improving customer experience.[2] Overall, it promotes traceability and operational reliability, contributing to lower costs and higher accuracy in commerce.[9] Originating in 1970s Europe, the EAN was developed as a compatible extension to the Universal Product Code (UPC) used in the United States, addressing the need for an international numbering system in expanding markets.[10]History and Development
The International Article Number (EAN) system originated in the mid-1970s as an extension of the Universal Product Code (UPC), which had been developed in the United States, to enable international product identification by adding a country prefix to the existing 12-digit structure. This adaptation addressed the need for a standardized numbering system beyond North America, allowing for global trade efficiency. The European Article Numbering Association (EAN International), the precursor to GS1, was formally established in 1977 in Brussels, Belgium, as a not-for-profit organization to coordinate the development and implementation of the EAN standard across Europe and beyond.[11][12] The first practical use of the EAN-13 barcode occurred on October 2, 1979, when a box of Melrose tea bags was scanned at a Key Markets supermarket in Spalding, Lincolnshire, United Kingdom, initiating its deployment in retail environments. In parallel, Japan adopted a localized variant known as the Japanese Article Number (JAN) system in 1978, becoming the first Asian country to implement EAN-compatible barcodes and facilitating its integration into domestic supply chains. By the 1980s, the EAN system rapidly expanded globally, with adoption in Europe, Asia, Africa, and other regions, as national organizations joined EAN International to assign country prefixes and promote standardized scanning in retail and logistics.[12][13] Key milestones in the system's evolution included the 2005 merger of EAN International and the Uniform Code Council (UCC) to form GS1, a unified global standards body operating in over 150 countries. This merger also marked the "Sunrise Date" for the full integration of EAN into the Global Trade Item Number (GTIN) framework, ensuring seamless compatibility between EAN-13, UPC-A, and other GTIN variants for worldwide product identification. In the 2020s, GS1 has advanced toward digital enhancements, such as the 2020 introduction of the GS1 Digital Link standard, which enables QR codes to encode GTINs and additional data, though the linear EAN barcode remains the dominant format for point-of-sale scanning, with billions of daily uses. As of 2023, GS1 announced the Sunrise 2027 initiative to support the global transition to 2D barcodes, such as QR codes using GS1 Digital Link, at retail points of sale by the end of 2027, enhancing data capacity and consumer engagement while maintaining compatibility with existing systems.[11][14][15]Standards and Organization
GS1 and Global Standards
GS1 is a global, non-profit organization dedicated to developing and disseminating standards for supply chain management and product identification, including the International Article Number (EAN) system. Founded in 2005 through the merger of EAN International and the Uniform Code Council, GS1 coordinates over 110 member organizations across more than 120 countries, enabling businesses worldwide to adopt uniform identification practices.[16][17] In relation to the EAN, GS1 serves as the central authority for assigning company prefixes, which form the initial digits of EAN codes and ensure unique product identification globally. These prefixes are allocated to companies via national or regional GS1 member organizations, requiring membership and licensing fees to maintain compliance with GS1 standards. This decentralized yet coordinated approach guarantees interoperability, allowing EAN barcodes to function seamlessly in international trade without duplication or conflict.[2][18] GS1 maintains the technical specifications for EAN through its foundational document, the GS1 General Specifications, which outlines rules for barcode encoding, data carriers, and identification keys. The latest version, Release 25.0 published in January 2025, enhances clarity on digital linkages and supports evolving technologies by integrating EAN data with web-based systems. Compliance with these specifications is mandatory for GS1 members to ensure EAN codes meet quality benchmarks for scanning reliability and data accuracy.[19][20] Recent updates to GS1 standards have increasingly incorporated EAN into broader ecosystems, particularly for radio-frequency identification (RFID) and Internet of Things (IoT) applications, facilitating real-time tracking and data sharing by 2025. For instance, the GS1 Digital Link standard embeds EAN identifiers into URLs, enabling machine-readable connections between physical products and digital information platforms. This evolution underscores GS1's role in adapting EAN for modern supply chains, where physical barcodes complement automated identification technologies.[21][22]Relation to GTIN and UPC
The Universal Product Code (UPC), specifically the UPC-A variant, is a 12-digit identifier primarily developed for and used in North America, particularly the United States and Canada, to streamline retail point-of-sale scanning.[23] In contrast, the International Article Number (EAN), most commonly in its 13-digit EAN-13 form, extends this system by adding a leading digit that serves as a country or regional prefix, such as 0 or 1 for products originating from the US or Canada. This design ensures backward compatibility, as an EAN-13 code starting with 0 or 1 effectively embeds a UPC-A code, allowing existing UPC scanners to interpret it correctly by ignoring or adjusting for the prefix during decoding.[1][24] The EAN-13 is formally classified as a Global Trade Item Number (GTIN-13) within the broader GTIN framework managed by GS1, which unifies product identification across global supply chains. GTINs encompass multiple formats—GTIN-8, GTIN-12 (equivalent to UPC-A), GTIN-13 (equivalent to EAN-13), and GTIN-14—to support diverse product packaging levels and international trade without requiring format alterations for data exchange. This standardization facilitates seamless compatibility in logistics and inventory systems, where a single GTIN can be encoded in various barcode symbologies like EAN/UPC, enabling efficient sharing of product information worldwide.[23][2][25] While UPC-A remains dominant in the US and Canadian retail sectors, EAN-13 is the preferred standard internationally for its explicit support of global prefixes and broader adoption outside North America. Both systems have been integrated under GS1 oversight since the 2005 merger of the Uniform Code Council (UCC) and EAN International, which harmonized their standards to promote unified global implementation.[23][26] This convergence ensures that products bearing either code can be scanned and processed interchangeably in most modern retail environments, enhancing cross-border commerce efficiency.[2]Structure and Composition
Components of EAN-13
The EAN-13 format encodes a 13-digit Global Trade Item Number (GTIN-13) used to uniquely identify trade items in global supply chains. This structure divides the digits into key components: a GS1 prefix, a company prefix, an item reference, and a check digit. The design ensures uniqueness while allowing flexibility for varying company sizes and product assortments.[27] The GS1 prefix comprises the initial 2 or 3 digits and designates the GS1 member organization, typically corresponding to a country or geographical region where the issuing company is registered. For instance, the range 300–379 is allocated to France (e.g., 3xx), 400–440 to Germany, while 000–019 applies to the United States and Canada, often integrating with the UPC system by prefixing a leading zero to 12-digit UPC codes. This prefix indicates the country of registration with GS1 and facilitates international standardization without directly indicating the product's manufacturing location, which may differ.[5] Following the GS1 prefix, the company prefix is a variable-length code assigned by the local GS1 member organization to the brand owner or manufacturer, identifying the entity responsible for the product. Its length typically ranges from 4 to 8 digits (resulting in a total company prefix of 6 to 10 digits when combined with the GS1 prefix), depending on the number of unique items the company requires to identify; shorter prefixes allow for more products, while longer ones suit smaller assortments. For example, a 6-digit company prefix (common in North America) provides space for up to 1 million item references.[5][23] The item reference occupies the remaining digits before the check digit (typically 2 to 6 digits) and is assigned by the company to specify a particular product variant, such as differences in size, weight, flavor, or packaging. Its length inversely varies with the company prefix to maintain a fixed total of 12 digits for these elements; for a 7-digit company prefix, the item reference would be 5 digits, enabling the company to distinguish up to 100,000 variants. This allocation ensures precise identification within the company's portfolio.[28] The final component, the check digit (the 13th digit), serves as a single verification numeral derived from the preceding 12 digits to detect common scanning or entry errors. It is computed using a standardized weighted sum modulo 10 method.[29] Overall, the fixed 13-digit length of EAN-13 balances global consistency with adaptability, as the variable partitioning of the company prefix and item reference accommodates diverse business needs without altering the total structure.[27]Variants Including EAN-8 and JAN
The EAN-8 is a compact 8-digit variant of the International Article Number system, developed for trade items where packaging space is insufficient for the EAN-13 barcode.[1] It encodes a Global Trade Item Number (GTIN-8), consisting of a 2- or 3-digit GS1 prefix assigned to national organizations, followed by a 4- or 5-digit item reference number, and a single check digit calculated using the same modulo-10 weighted sum method as the EAN-13.[25] This format is reserved for small consumer products and is rarely assigned due to limited numbering capacity, with usage primarily limited to items like confectionery, cosmetics, and pharmaceuticals sold at retail point-of-sale.[30] The Japanese Article Number (JAN) represents a localized adaptation of the EAN-13 for the Japanese market, utilizing GS1 prefixes beginning with 45 or 49 to denote origin in Japan.[31] Introduced when Japan joined the EAN Association (now GS1) in 1978 with the initial prefix 49, it was expanded in 1992 to include 45 for additional capacity; the structure mirrors the EAN-13, comprising a prefix, company prefix, item reference, and check digit.[31] Managed exclusively by GS1 Japan, JAN codes are the standard identifier for consumer goods in Japanese retail and distribution, effectively mandatory for products entering the domestic market to ensure compatibility with point-of-sale systems.[32] JAN also accommodates book identification through integration with the International Standard Book Number (ISBN) system, where a 10-digit ISBN (excluding its check digit) is prefixed with 978 or 979 to form a 13-digit GTIN-13, followed by a recalculated EAN check digit for barcode encoding.[33] Unlike some regional systems, there is no distinct EAN-12 format; 12-digit codes align with the UPC-A standard used mainly in North America.[2]Checksum Calculation
Weighted Sum Method
The weighted sum method is a modulo-10 algorithm used to calculate the check digit for the EAN-13 code, ensuring the integrity of the 13-digit identifier by verifying the first 12 digits through weighted summation.[34] This approach applies alternating weights of 3 and 1 to the digits, starting from the right, to produce a sum that determines the final check digit.[34] Positions for weighting are numbered from right to left across the first 12 digits, with position 1 assigned to the rightmost digit (excluding the check digit position). Odd-numbered positions (1, 3, 5, etc.) are multiplied by 3, while even-numbered positions (2, 4, 6, etc.) are multiplied by 1.[34] This right-to-left orientation aligns with the standard convention for GTIN-13 computation as defined by GS1.[34] The check digit is derived from the following formula: where is the digit in position (right to left), and if is odd, if is even. The check digit is then: This ensures the total sum including the check digit is congruent to 0 modulo 10.[34] The method excels in error detection, reliably identifying all single-digit substitution errors and most adjacent digit transpositions, thereby validating code accuracy during scanning or manual entry.[35] It achieves 100% detection for single-digit errors, enhancing reliability in supply chain applications.[35]Calculation Examples
To illustrate the application of the weighted sum method for calculating the EAN check digit, the following worked examples demonstrate the process step by step for both EAN-13 and EAN-8 formats. These examples use the standard modulo-10 algorithm, where the weighted sum of the first 12 (for EAN-13) or 7 (for EAN-8) digits is computed with alternating multipliers of 3 and 1 starting from the rightmost digit (multiplied by 3), and the check digit is then determined as (10 - (sum mod 10)) mod 10 to ensure the total weighted sum of all digits (including the check digit multiplied by 1) is a multiple of 10.[36]Example 1: EAN-13 Check Digit Calculation
Consider the first 12 digits of a product code: 210987654321. The check digit is calculated as follows:- Assign multipliers starting from the right: the rightmost digit (1) is multiplied by 3, the next left (2) by 1, then 3, 1, and so on, alternating.
| Position (left to right) | Digit | Multiplier | Weighted Value |
|---|---|---|---|
| 1 | 2 | 1 | 2 |
| 2 | 1 | 3 | 3 |
| 3 | 0 | 1 | 0 |
| 4 | 9 | 3 | 27 |
| 5 | 8 | 1 | 8 |
| 6 | 7 | 3 | 21 |
| 7 | 6 | 1 | 6 |
| 8 | 5 | 3 | 15 |
| 9 | 4 | 1 | 4 |
| 10 | 3 | 3 | 9 |
| 11 | 2 | 1 | 2 |
| 12 | 1 | 3 | 3 |
- Sum the weighted values: 2 + 3 + 0 + 27 + 8 + 21 + 6 + 15 + 4 + 9 + 2 + 3 = 100.
- Compute the remainder: 100 mod 10 = 0.
- Check digit = (10 - 0) mod 10 = 10 mod 10 = 0.
Example 2: EAN-8 Check Digit Calculation
For smaller packages, EAN-8 uses the first 7 digits, such as 7654321. The process mirrors EAN-13 but with fewer digits:- Assign multipliers from the right: rightmost digit (1) by 3, next (2) by 1, alternating.
| Position (left to right) | Digit | Multiplier | Weighted Value |
|---|---|---|---|
| 1 | 7 | 3 | 21 |
| 2 | 6 | 1 | 6 |
| 3 | 5 | 3 | 15 |
| 4 | 4 | 1 | 4 |
| 5 | 3 | 3 | 9 |
| 6 | 2 | 1 | 2 |
| 7 | 1 | 3 | 3 |
- Sum the weighted values: 21 + 6 + 15 + 4 + 9 + 2 + 3 = 60.
- Compute the remainder: 60 mod 10 = 0.
- Check digit = (10 - 0) mod 10 = 0.
Example 3: Detecting Errors with Check Digit Validation
The check digit also serves to detect common errors, such as transcription mistakes. Using the EAN-13 example above, suppose the code is entered incorrectly as 2109876543211 (check digit changed to 1). Compute the full weighted sum, now including the erroneous check digit multiplied by 1 from the right:- Weighted sum of first 12 digits: 100 (as before).
- Check digit contribution: 1 × 1 = 1.
- Total: 100 + 1 = 101.
- 101 mod 10 = 1 (not 0), indicating the code is invalid.
Barcode Encoding
Overall Structure
The International Article Number (EAN) barcode is a linear one-dimensional symbology designed for encoding product identification numbers in retail environments. The EAN-13 format, the primary variant, features a structured layout of alternating black bars and white spaces that represent a 13-digit Global Trade Item Number (GTIN). This layout ensures reliable scanning by point-of-sale devices and includes essential elements for synchronization and error prevention. The entire symbol is typically printed with a human-readable interpretation (HRI) of the full GTIN beneath the bars for manual verification. The first digit is printed to the left of the bars but not encoded within them.[2] At its core, the EAN-13 barcode anatomy comprises a left guard pattern at the start, followed by the left data area encoding the second through seventh digits using a combination of odd (L) and even (G) parity patterns based on the first digit, a center guard pattern separating the data sections, the right data area encoding the eighth through thirteenth digits (including the check digit) using even parity patterns (R-codes), and a right guard pattern at the end. The guard patterns are fixed sequences of narrow bars and spaces—specifically, three narrow elements for the left and right guards (binary 101) and five for the center guard (binary 01010)—that signal the scanner's starting point, midpoint, and stopping point, while also indicating scan direction to support omnidirectional reading from any angle across the symbol. This design, defined in the GS1 General Specifications and ISO/IEC 15420, allows for efficient processing in high-volume retail scanning without requiring precise alignment.[38] To maintain scannability, the symbol must adhere to precise dimensional standards. The nominal X-dimension, representing the width of the narrowest bar or space (one module), is 0.33 mm, providing a baseline for magnification ratios between 80% and 200% in point-of-sale applications. The nominal bar height for EAN-13 is 25.93 mm at 100% magnification, measured from the base to the top of the bars (excluding extensions on guard patterns), with minimum heights scaling by magnification (e.g., 20.74 mm at 80%), ensuring sufficient contrast and resolution for laser or imaging scanners. Quiet zones, blank areas devoid of any printing or markings, flank the symbol and must extend a minimum of 11X on the left (approximately 3.63 mm) and 7X on the right (approximately 2.31 mm) at nominal size to isolate the barcode from surrounding text or graphics, preventing misreads. These specifications, as outlined in the GS1 General Specifications, guarantee compatibility across global supply chains and scanning technologies.[38]Digit Encoding Patterns
In the EAN-13 barcode symbology, each of the 12 data digits (excluding the check digit, which is encoded separately) is represented by a unique 7-module binary pattern consisting of bars and spaces, where each module is a unit of width defined by the X-dimension. The left-hand side digits use either odd-parity encodings (L-codes, starting with a space and containing an odd number of bars) or even-parity encodings (G-codes, starting with a space and containing an even number of bars), while all right-hand side digits use even-parity encodings (R-codes, starting with a bar and ending with a space, with an even number of bars). These patterns ensure reliable scanning by distinguishing the symbol's orientation and position. The encoding is defined in ISO/IEC 15420, as incorporated in the GS1 General Specifications.[38] The complete set of encoding patterns comprises 20 distinct codes: 10 L-codes, 10 G-codes, and 10 R-codes. The following table lists the binary representations (where 0 denotes space and 1 denotes bar) for digits 0 through 9 in each encoding type:| Digit | L-code | G-code | R-code |
|---|---|---|---|
| 0 | 0001101 | 0100111 | 1110010 |
| 1 | 0011001 | 0110011 | 1100110 |
| 2 | 0010011 | 0011011 | 1101100 |
| 3 | 0111101 | 0100001 | 1000010 |
| 4 | 0100011 | 0011101 | 1011100 |
| 5 | 0110001 | 0111001 | 1001110 |
| 6 | 0101111 | 0000101 | 1010000 |
| 7 | 0111011 | 0010001 | 1000100 |
| 8 | 0110111 | 0001001 | 1001000 |
| 9 | 0001011 | 0010111 | 1110100 |