Home:  Products:  UPC / EAN Barcode:  UPC / EAN Barcode FAQ & Tutorial:

UPC-A barcode exampleUPC / EAN Barcode FAQ & Tutorial

UPC/EAN Overview and Various Standards

The UPC and EAN barcode types have been in use since the 1970s to encode Global Trade Item Numbers (GTIN) which uniquely identify a product for retail checkout or tracking purposes. DataBar-14 (formerly RSS-14) may also be used for the same purpose, which is a smaller and more advanced barcode type that may be used in all retail checkout systems after January 1, 2010. UPC, UCC, EAN, JAN, GTIN-8, GTIN-12 and GTIN-13, ISBN and Bookland barcodes are all created from the same symbology type which is commonly known and UPC/EAN.

GTIN Compliance

To be fully GTIN (Global Trade Item Number) compliant, all UPC and EAN numbers should be stored in databases as 14-digit numbers and filled in with zeros for the spaces to the left as shown in Fig: 1. For example, a UPC-A barcode of 123456789012 would be represented as 00123456789012 in the database of a GTIN compliant system. When encoding complete GTIN-14 numbers, GS1 DataBar should be used.

Fig: 1. The various types of UPC and EAN barcodes with their GTIN capability

Barcode Type GTIN Type GTIN Storage Barcode Example
EAN-8 GTIN-8 00000012345670 EAN-8 Barcode Example
UPC-A GTIN-12 00123456789012  UPC-A Barcode Example
UPC-E GTIN-12 00023400000900** UPC-E Barcode Example
EAN-13, JAN, ISBN, ISSN and Bookland GTIN-13 01234567890128 EAN-13 Barcode Example
GS1 DataBar * GTIN-14 12345678901231
(01)12345678901231
GS1 DataMatrix GTIN-14 00012345678905
(01)00012345678905

* GS1 DataBar (previously known as RSS-14) actually encodes 13 digits with the required AI of 01 and a DataBar check digit. The last digit of the GTIN-14 is a MOD 10 check digit and is not encoded in the DataBar symbology. If the full 14-digit GTIN is needed after reading the symbol, it may be generated with a MOD10 calculation. The GS1 DataBar Symbology may be used in all retail checkout systems after January 1, 2010.

** The UPC-E number of 02349036 displayed in the barcode equals the 00023400000900 UPC-A number after it is expanded by the UPCE compression rules. This compression algorithm may be obtained by examining the UPCe7To11 function in IDAutomation's Visual Basic Source Code, which is used to automate printing for IDAutomation's UPC Barcode Font.

Printing UPC & EAN

Several Barcode Integration Guides are available that suggest one or more barcode printing options. These integration options should be examined to determine whether to use barcode components, applications or fonts for the printing of barcodes. A few of the Barcode Integration Guides offered include the following:

Featured Product:

IDAutomation's UPC/EAN Font Advantage Package is a single font used to create all UPC-A, UPC-E, EAN-8, EAN-13, JAN, ISBN and Bookland barcodes. The font meets current ANSI, ISO and IEC 2000 specifications (ISO 15420:2000) and is supplied with several font tools, plug-ins and source code samples for easy application integration. When creating a single barcode, the online font encoder may be easily used with the UPC/EAN Font.

IDAutomation offers many other products for the generation of barcodes. For a thorough evaluation of these products, visit the Barcoding for Beginners FAQ and Tutorial.

Reading or Scanning UPC/EAN Barcodes

The most common method of reading barcodes is with a barcode scanner. Most of the barcode scanners recommended by IDAutomation perform keyboard emulation and receive power from the USB port, so that no external power supply is required. When a barcode is scanned using keyboard emulation, the data scanned appears at the cursor as if it had been typed in from the keyboard.

Most barcode scanners have the ability to read UPC and EAN barcodes by default, such as the hand-held IDAutomation USB Scanner. This scanner dependably reads IDAutomation’s UPC/EAN Font when printed at any size allowed by GS1, which is from 12 to 32 points.

The UPC and EAN Character Sets

The character set for this symbology is best described by viewing the UPC/EAN Font Specifications. This site demonstrates how the symbols are created from the characters found in the different character sets.

To provide for easy integration into applications, IDAutomation provides several Font Tools that are free to use with IDAutomation fonts. Therefore, references to the character sets should not be necessary. When it is only necessary to create a single barcode, IDAutomation recommends using the Online Font Encoder.

MOD 10 Check Character Calculation

The check digit is also referred to as the check character and checksum, and it is always the last digit in the GTIN number. The manual calculations described below are rarely necessary because IDAutomation provides several font tools, plug-ins and source code samples that are free to use with IDAutomation fonts, which automatically format text to the barcode fonts. Additionally, the check digit option in all components and applications calculates and includes the checksum automatically.

A modulus 10 check digit is used for consistency verification in all UPC-A, UPC-E, EAN-13 and EAN-8 barcode types. The check digit calculation for UPC-E requires the original UPC-A number.

The UPC/EAN system uses a unique process to determine the check digit, which is determined by the following modulus 10 algorithm:

  1. Add up the odd numbers (the rightmost character is odd) in the digits and multiply them by 3.
  2. Add up the even numbers.
  3. The check digit is obtained by determining the smallest number, that when added to the sum of steps 1 and 2, will produce a multiple of 10. For example, the check digit for a UPC-A number of 12345678901 is 2 because (3*(1+3+5+7+9+1))+(2+4+6+8+0) = 98 and 98 + 2 =100.
  4. The check digit may be verified online by choosing the "MOD10" button on our barcode font encoder.

The following Visual Basic code is an example of calculating the MOD10 check digit:
   Factor = 3
   WeightedTotal = 0
   For I = Len(DataToEncode) To 1 Step -1
     CurrentCharNum = Mid(DataToEncode, I, 1)
     WeightedTotal = WeightedTotal + (CurrentCharNum * Factor)
     Factor = 4 - Factor
   Next I
   I = (WeightedTotal Mod 10)
   If I <> 0 Then
     CheckDigit = (10 - I)
   Else
     CheckDigit = 0
   End If

Related Information Links

 

Copyright © 2000-2007 IDAutomation.com, Inc. Legal Notices.

Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.