img

Cognex Mobile Barcode Scanner SDK
EAN

What is EAN?

EAN code (also called EAN-13 and EAN-8) is the product labeling barcode used throughout Europe and much of the world. Originally called European Article Number, it is now referred to as International Article Number though its acronym has been retained. Like its predecessor, UPC, it is both a barcode symbology as well as a standardized numbering scheme for its use for country assignments. Unlike many other more general barcode symbologies (e.g., Code 39, Code 128, Code 25), its purpose-built for a specific datum: a 12-digit product code (with EAN-8 representing 8-digit product codes).

A brief history

After the successful adoption and standardization of Universal Product Codes (UPC) in the early 1970s US market, the 12 member countries of the European Community set out to adopt a barcode standard for retail operations as well. In 1976, the EAN symbology was adopted. It is a superset of UPC, using the same symbol characters, check digit algorithm, and general structure. A UPC number (which is 12 digits) can easily be converted to an EAN-13 by simply prepending a 0. The check digit will be unaffected and remain the same.

The most significant enhancement was the addition of a country identifier, which UPC does not include, limiting its use to fewer markets.

Symbology

There are two generally used EAN symbologies: EAN-13 and EAN-8. Other, less common symbologies include EAN-2 and EAN-5. All are numeric-only, fixed-length symbologies. An EAN-13 is 13 digits long (12 data and a check digit) while an EAN-8 is 8 digits long (7 data and a check digit). EAN is a linear, one-dimensional (1D) barcode. This means the barcode is composed of a single set of varying-width vertical lines (black) and spaces (white). Below is a simple example of both an EAN-13 and an EAN-8 barcode:

 

pages_EAN-13_example.pngpages_EAN-8_example1.png

 

It is further characterized as continuous; that is, there is no inter-character space between adjacent characters. The space between characters is part of the data representation. Just like UPC, each data character is represented by a unique pattern of two bars and two spaces, with bars/spaces being one, two, three, or four modules wide; each data character is a total of seven modules wide.

Again, just like UPC-A, EAN-13 uses a start pattern, a stop pattern, a middle (guard) pattern, and a single check digit.

Parity

It is worth noting that this symbology uses a parity scheme for its data characters. Depending on where a digit appears in the symbol, the pattern used to represent the digit will have either odd parity or even parity. Odd parity means that the total width (in modules) of the black bars used for the digit is odd, while even parity means the total width of the black bars is even. Hence, every digit (0-9) has two bar/space patterns: one with odd parity, and the other with even parity.

Unlike UPC-A though, which encodes the first 6 digits with odd parity and the other 6 digits with even parity, it uses a much more sophisticated scheme.

To encode a 13-digit EAN, the number is broken into three groups of one, six, and six digits. The first digit is not actually represented by a data character; rather it is represented by the odd/even parity pattern of the characters used to represent the first group of 6 digits. The second group of 6 digits is always represented using even parity. This allows an EAN-13 barcode to represent 13 digits in the same space as a UPC-A (12 digits). Further, when the first digit of the EAN-13 is 0 (meaning the EAN-13 contains a 12-digit UPC), the pattern used for the first 6 digits is all odd parity, resulting in the exact same symbol as UPC-A.

Here is our EAN-13 example from above, diagramed for clarity:

 

pages_EAN-13_diagramed.png

 

By counting the module width of each of the first 6 data characters, we observe that the parity pattern in use is odd, odd, even, even, odd, even (OOEEOE), which is the pattern for the number 2 (the first digit of the EAN-13).

Numbering

EAN uses an even more complex numbering scheme than its predecessor, UPC. The first 3 digits were originally designated as a country code (indicating where the product manufacturer is registered—not necessarily where the product was made or sold), though general-purpose codes have since been added and these first 3 digits are now referred to as the GS1 Prefix (as GS1 is the standards body over EAN as well as UPC). Here are just some of the GS1 prefixes (see the GS1 Prefix List on the GS1 website for a complete list):

 

GS1 Prefix

Country/use

000 – 019

United States

020 – 029

Restricted distribution (member organization-defined)

030 – 039

United States

040 – 049

Restricted distribution (member organization-defined)

050 – 059

Coupons

300 – 379

France

400 – 440

Germany

500 – 509

United Kingdom

750

Mexico

900 – 919

Austria

977

Serial publications (i.e., magazines: International Standard Serial Number, or ISSN)

978 – 979

Bookland codes (International Standard Book Number, or ISBN)

 

The remaining 9 digits are typically divided into a manufacturer code and product code; the number of digits for each can vary by country code. This division and the assignment of manufacturer codes is done within each country by the country’s GS1 member organization.

EAN-8

EAN-8 is similar to UPC-E in that it is intended primarily for small package labeling where a full EAN-13 may not fit. Unlike UPC-E though, EAN-8 codes are not a compressed form of EAN-13. All 8 digits of the EAN-8 number are encoded in the barcode symbol (whereas UPC-E uses parity to represent two data digits).

An EAN-8 number consists of either a 2 or 3-digit county code, followed by a 5 or 4-digit product code (plus a check digit as the 8th digit). EAN-8 codes are assigned to specific products directly by the numbering authority (GS1).

AN EAN-8 symbol is constructed in much the same fashion as an EAN-13, using the same start, center, and stop patterns. EAN-8 does not encode any of the data using parity; similar to a UPC-A, EAN-8 uses all odd parity characters for the first four digits and all even parity characters for the last four digits. Here is our original EAN-8 example, diagramed for clarity:

 

pages_EAN-8_diagramed.png

 

Who uses EAN?

While initially a European country initiative, EAN is now used on millions of consumer products around the world and across many industries and has become a true international standard. It has proven more adaptable than UPC and has thusly found more uses:

  • Periodicals – magazines and other serialized publications include an ISSN (International Standard Serial Number), an EAN-13 with the country code 977;
  • Books – use an ISBN (International Standard Book Number), or Bookland code. This EAN-13 uses a country code of 978 or 979;
  • Music – a newer standard, the International Standard Music Number (ISMN), is an EAN-13 with the country code 979 used to identify notated music publications.

Just like with the UPC code, the explosive growth of mobile devices and applications has led to many additional, consumer-facing uses of EAN barcodes as well:

  • Comparative shopping
  • Product reviews
  • Detailed product and manufacturer information
  • Competitive product recommendations
  • Safety and recall information
  • Detailed ingredient lists
  • Allergen information
  • And many more!

How do we help developers using EAN?

The Cognex Mobile Barcode Scanner SDK supports EAN detection, enabling developers to gather relevant workflow and application data into their own barcode-scanning apps. You can download the SDK for free by registering on the Cognex Mobile Barcode Developer Network. In addition, the Barcode Scanner SDK supports a broad range of symbologies to meet your growing development needs. Packaged with the consumer product barcodes of UPC, GS1 Databar, PDF417, and QR Code, the SDK Consumer Developer License (CDL) lets you deliver a powerful retail experience quickly and easily.

Get Started