EAN 13 Barcode Explained

Code EAN 13 Example

Introduction to EAN 13

Code EAN 13 is by far the most common barcode symbology worldwide. Used exclusively in retail and at the point-of-sale, almost every product carries an EAN barcode. EAN, short for European Article Numbering, is derived from the US-american UPC barcode symbology and was introduced in Europe in the early 1970s. EAN 13 encodes twelve digits and a check digit, hence the name; a shorter variant (eight digits) is EAN 8.

Contents:

  1. How to recognize an EAN 13 barcode
  2. EAN 13 vs UPC-A
  3. EAN 13 vs GTIN-13
  4. EAN 13 vs GTIN-14
  5. Data content of an EAN 13 barcode
  6. EAN country codes
  7. In-house EAN 13
  8. EAN 13 add-on codes
  9. EAN 13 SC sizes
  10. EAN 13 check digit calculation
  11. How to get an EAN 13 code
  12. Scanning EAN 13 barcodes
  13. EAN 13 printing considerations, label printers & recommended file formats
  14. Online barcode generators for EAN 13
  15. Create EAN barcodes with a font
  16. Creating EAN 13 barcodes in Adobe Illustrator, InDesign
  17. Creating EAN 13 with a stand-alone barcode generator
  18. Bulk creating EAN 13
  19. Creating EAN 13 in Excel, Google Sheets
  20. Creating EAN 13 with Node JS, Python, C#, PHP, Java, Swift

How to recognize an EAN 13 barcode

An EAN 13 barcode is easily recognized: It always starts and ends with two thin bars, the "start" and "stop" patterns. It also has two thin bars right in the center of the symbol. We've highlighted those patterns here:

Screenshot: Recognize Code EAN 13

When printed with human-readable text, the first digit is placed to the left of the code. Additionally, a ">" (also known as light margin indicator or LMI) can be placed to the right of the code. Both features indicate the so called "quiet zones". This space must be kept free of other graphical elements.

A "module" is the thinnest bar of a barcode symbol. The selected SC size (see below) determines the width and height of a module from which all other dimensions are derived.

Here's the code from the introduction with annotations:

Annotated example of Code EAN 13

EAN 13 vs UPC-A

Major differences (and similarities) between EAN 13 and UPC-A:

  1. EAN 13 encodes thirteen digits (twelve digits for data, one check digit) while UPC-A encodes twelve digits (eleven for data plus check digit). Any UPC-A data string can be encoded into an EAN 13 symbol by prepending "0" (in lieu of the "country code") to the data.
     
  2. Bit patterns of EAN and UPC are actually identical, likewise the Modulo 10 check digit calculation is the same.

    Here's an example; both codes encode "01234567890" and have an identical check digit ("5"):

    Code EAN 13 vs UPC-A - Differences and Similarities
  3. Placement of human readable text is slightly different as can be seen in the image; with UPC-A, the first and the last digit are set outside the actual code symbol while with EAN only the first digit is outside. In both cases, the "external" digits have the purpose of keeping the space left and right of the code free of other graphical elements to improve the scanning reliability. With EAN, the standard recommends to add a ">" to the right of the code to assume the role of UPC's twelfth digit.

EAN 13 vs GTIN-13

Originally the 13 digit EAN number and the 13 digit EAN code were both referred to as EAN 13. Unifying the separate EAN and UPC standards under the GS1 umbrella introduced the GTIN (from Global Trade Item Number) to the world. The previous 13 digit EAN number became the GTIN-13 - another name but the same data content. With the introduction of new barcode symbologies (namely Code 128 GS1 and Data Matrix GS1) the EAN 13 barcode is now just one of several barcode symbologies that can be used to create a machine-readable representation of a GTIN-13.

EAN 13 vs GTIN-14

Any EAN 13 number (i.e. GTIN-13) can be converted into a GTIN-14 by prepending a "0" to the data. Once converted, the GTIN-14 can be encoded into Code 128 GS1, Data Matrix GS1 or ITF-14 barcodes.

Data content and format of an EAN 13 barcode

EAN 13 encodes twelve digits plus a mandatory check digit, hence the name EAN 13. The thirteen digits of an EAN 13 encode the following content:

Digit 1-2: Country identifier, e.g. 40, 41, 42, 43, 44 for Germany *

Digit 3-7: Manufacturer identifier **

Digit 8-12: Article number

Digit 13: Check digit

* Country code plus manufacturer identifier is also known as "company prefix", the two digits of the country code usually denote the country of the issuing GS1 branch; however, that's not necessarily the country where the article was produced. Codes beginning with "450" to "459" are used exclusively in Japan, here EAN 13 is referred to as JAN (Japanese Article Number). See nect section for a lit of country prefixes.

** Length can vary; larger manufacturers have shorter IDs for a bigger pool of available article numbers; GS1 maintains a database of manufacturers

EAN country codes

List of notable EAN country codes and prefixes:

  • 000-099: UPC-A compatible EAN codes
  • 100-139: USA
  • 200-299: Inhouse (restricted) EAN codes (see next section)
  • 300-379: France and Monaco
  • 380-390: Former Yugoslav regions
  • 400-440: Germany
  • 450-459: Japan ("new" JAN)
  • 471: Taiwan
  • 470, 474-488: Former USSR / Soviet regions
  • 490-499: Japan ("old" JAN)
  • 500-509: United Kingdom (England, Wales, Scotland, Northern Ireland)
  • 539: Republic of Ireland
  • 540-549: Belgium, Luxembourg
  • 560: Portugal
  • 569: Iceland
  • 570-579: Denmark, Faroe, Greenland
  • 590: Poland
  • 600-631: Africa and Middle East countries
  • 640-649: Finland
  • 690-699: China (Mainland)
  • 700-709: Norway
  • 729: Israel
  • 730-739: Sweden
  • 740-750: Central America
  • 754-755: Canada
  • 760-769: Switzerland, Liechtenstein
  • 770-790: South America
  • 800-839: Italy, San Marino, Vatican
  • 840-849: Spain, Andorra
  • 870-879: Netherlands
  • 880: South Korea
  • 883-899: South-East Asia
  • 900-919: Austria
  • 930-939: Australia
  • 940-949: New Zealand
  • 977: ISSN, see here
  • 978-979: ISBN, see here
  • 980-999: Coupons

EAN 13 containing price information (Restricted Circulation Numbers)

EAN 13 codes beginning with "20" - "29" are so-called in-store or in-house codes (officially: Restricted Circulation Numbers). They encode prices or weights, for example of produce or other articles where the sales price depends on the weight. Here's an example of an in-store EAN for salad that encodes a price (EUR 1.94):

EAN 13 In House Barcode with price

An identical code, created with the Softmatic Barcode Extension for Adobe Illustrator:

EAN 13 In Store Barcode

In-house EANs will literally only work properly at the store where they were created; in other stores the codes will be rejected at checkout.

EAN 13 add-on barcodes

An EAN 13 symbol can carry an add-on barcode, sometimes also called a satellite code. The add-on can encode another two or five digits of data. This is used with ISBN barcodes (books) and ISSN barcodes (serials & periodicals).

Example EAN 13 with a five digit add-on code:

Sample Code EAN 13 with Add-on

EAN 13 SC sizes

EAN 13 sizes are standardized (see this reference of EAN SC sizes). The module width and height are only allowed to vary within certain limits. The default, or 100%, size is called SC2. For SC2, the module width is set to 0.33mm, the height to 22.85mm. This yields a barcode that is roughly 26mm high and 37mm wide (including the textline and the left and right quiet zones):

EAN 13 Size and Dimensions

It is permitted to vary the module width down to 80% and up to 200%. In addition, it is permitted to reduce the height to some degree, this is also known as truncation. As a rule, the height of a standard-sized EAN 13 should not be below 10mm.

Example of a truncated EAN (50%):

Sample Code EAN 13 Truncated

Code EAN 13 check digit

EAN 13 uses a modulo 10 checksum scheme. Starting from the right the numbers are multiplied alternating with "3" and "1" and added up. The sum is integer divided by ten, the reminder (or modulo) is subtracted from ten which then yields the check digit.

Example check digit calculation for Code EAN 13

Using the sample barcode from above, our numbers are "401234567890".

Summing up: 0 * 3 + 9 * 1 + 8 * 3 + 7 * 1 + 6 * 3 + 5 * 1 + 4 * 3 + 3 * 1 + 2 * 3 + 1 * 1 + 0 * 3 + 4 * 1 = 89
Dividing: 89 / 10 = 8 Reminder 9
Check digit: 10 - 9 = 1

Note that using a check digit is mandatory. A code without the proper check digit will not scan. All Softmatic barcode products will automatically calculate the EAN check digit to ensure that a valid symbol will be created.

How to get an EAN 13 code

EAN numbers are maintained and issued by your country's GS1 branch, please see obtaining an EAN number for details. Only the national GS1 branches can issue valid (i.e. unique) company prefixes and numbers. Once you've been assigned a pool of EAN numbers, you can use one of Softmatic's barcode generators to create the actual, valid EAN 13 barcodes, see below for the various options.

NOTE: We do not recommend obtaining EAN 13 numbers from third parties who advertise on the Internet or Ebay with slogans like "Only need one EAN barcode?". These vendors will sell you a number from their own pool, exploiting a (historic) loophole in the assignment of EAN / UPC numbers. While those numbers are in principle valid, there's no guarantee that they are actually unique. In many cases the numbers are reused or they are re-assigned UPC numbers that were made EAN-compatible by adding a leading "0" to the twelve digit UPC number.

Sample Code EAN 13

Sample shows an EAN 13 in SC 2 size with human-readable text and light margin indicator:

Code EAN 13 Example

Scanner recommendation for Code EAN 13

It is safe to assume that all barcode scanners available today support reading EAN 13. Especially older barcode scanners may have problems with low resolution codes or when reading from a distance. Most current smartphones can read barcodes with the built-in camera, either with the "Camera" app or with a dedicated barcode scanner app.

Video shows the CoScan app, a free PDF and barcode scanner for iPhone. The barcodes (EAN 13, Code 128 and QR) are correctly identified and decoded in the life image:

AppStore (free download)

EAN 13 is a very demanding barcode with tight tolerances in the range of 1/100mm (less than half a thou in inches). The minimum recommended print resolution is 300dpi. This is usually not a problem when printing the barcode with current laser or thermal printers. When printing with inkjets, choosing the right paper is paramount; most standard copier or laser paper will behave like blotting paper and cause so called ink spread. This effect will "thicken" the bars of the code, resulting in a symbol that does not conform to the standard.

In many cases, the barcode will have to be created with reduced bar width to compensate for ink spread or -growth. The amount of bar width reduction depends on the respective printing process. Laser, thermal or offset printing will have very low values (to the order of 0-2%) while silicon pad or screen printing will have higher values.

EAN 13 vector and raster file formats

Whenever possible, EAN 13 codes should be stored in a vector format, preferrably PDF. All current Softmatic barcode generators create codes as dependency-free CMYK PDFs with "pure black", i.e. C0 M0 Y0 K100. Avoid so called "rich blacks" (e.g. C50 M50 Y50 K100) which can cause issues with mis-aligned printing plates. SVG is an alternative but can cause conversion problems in pre press because CMYK color representation within an SVG is not widely supported. When using vector formats is not an option, CMYK-TIFFs are the second best choice, followed by PNG. Lossy formats like JPEG should be avoided.

Older versions of the Softmatic barcode generators would also create EAN codes as EPS. This format is no longer recommended as the EPS format is now considered unsafe; many applications will no longer import EPS files (example).

Online generators for EAN barcodes

A quick search for "create ean barcode online" will produce quite a few web services, some of which will also create EAN 13 codes. However, online generators are not without issues, especially when it comes to the very demanding and tightly specified EAN barcodes. We found that the created codes do often not comply with the GS1 standard; some generators will even let you enter arbitrary data, resulting in invalid codes. Here's an example EAN 13 from an online generator:

Online EAN Barcode Generator Wrong Check Digit

This is not a valid EAN 13 barcode; the final and check digit ("2") is wrong, it should be "7". As a result, this barcode will not scan. In addition, the GS1 makes precise requirements how to format and place the human readable text which the online generator clearly does not respect. It goes without saying that such a barcode will make your packaging or artwork look extremely unprofessional.

Compare to a standards compliant EAN 13:

Compliant EAN ISBN

Here's an example from another online barcode generator:

Online EAN Barcode Generator Sample Quality Issues

This online generator has the correct check digit but the text is far too small and the overall resolution is too low. This results in a symbol where the spaces and bars are very uneven; this is very noticable near the center of the code. The three single-width bars we highlighted in the image should all have the exact same width which they clearly don't. Likewise, the two-width bar directly to the left is far too thick. With some luck, the code will scan if printed with high enough resolution; however, it is evident that it does not comply with the standard and will fail a test with a barcode verifier.

Create EAN 13 barcodes with a font

Barcode fonts are a quick and easy way to create barcodes - provided the barcode is not too complicated, a good example would be Code 39. With EAN 13, using a barcode font is more involved because there is no direct mapping between the EAN number and the characters of the font. It is therefore not sufficient to simply select the numbers in Word, Excel or Google Docs and change the font to "EAN 13". Additional software is needed to calculate the check digit and prepare the number to work with the barcode font's character mapping.

Other problems come from the fact that the font renderer may try to "beautify" the text output. This causes small positional adjustments for each character which may render the code out of spec. Finally, as we've seen above, the created EAN barcode may require bar width reduction to compensate for ink spread, something that's impossible to achieve with a font.

Create EAN 13 barcodes in Illustrator, InDesign

Easy to use barcode plug-ins and extensions for the Adobe flagship applications, seen here in Adobe Illustrator:

Softmatic's extensions for Adobe InDesign, Illustrator und Photoshop let you create EAN 13 directly in your documents and designs. For more videos, see the Softmatic Youtube Channel.

The Softmatic barcode plug-ins and extensions for InDesign, Illustrator and Photoshop are available from the Softmatic online store.

Stand-alone EAN 13 generator

Fast and easy creation of standards-compliant EAN 13 barcodes with BarcodePlus V5, Softmatic's time tested barcode generator:

EAN 13 Barcode Bulk Generator

For batch creation of EAN 13 and the related ISBN / ISSN codes, use Softmatic BarcodeFactory V5, our time-tested bulk barcode generator. The software will create thousands of EAN symbols in seconds, with data coming from the built-in serial number generator, the clipboard or via import from Excel, Numbers or CSV text files. Ideal for mass creation of artwork for packaging, book or magazine covers etc.:

Generate EAN 13 barcodes with a font in Excel or Google Sheets

An easy way to add EAN 13 codes to your spreadsheet is via a barcode font. An add-in or macro that is supplied with the font handles check digit calculation and data conversion to create a valid barcode, like in this example:

EAN 13 barcode font in Excel

More about the Softmatic EAN 13 add-in for Excel.