Barcode Basics >
Different Types of
Barcodes > EAN-13
EAN-13 is used world-wide for marking retail goods. The symbol encodes
13 characters: the first two or three are a country code which
identify the country in which the manufacturer is registered (not necessarily where the
product is actually made). The country code is followed by 9 or 10 data digits
(depending on the length of the country code) and a single digit checksum. 2-digit and
5-digit supplemental barcodes may be added for a total of 14 or 17 data digits.
The Uniform Code Council (the organization
which issues retail codes in the USA) has announced that January 1, 2005 will be the date
by which all retail scanning systems in the USA must be able to accept the EAN-13 symbol
as well as the standard UPC-A. This change will eliminate the
need for manufacturers who export goods to the US and Canada to double-label their
The checksum is a Modulo 10 calculation:
- Add the values of the digits in the even-numbered positions: 2, 4, 6, etc.
- Multiply this result by 3.
- Add the values of the digits in the odd-numbered positions: 1, 3, 5, etc.
- Sum the results of steps 2 and 3.
- The check character is the smallest number which, when added to the result in step 4,
produces a multiple of 10.
Example: Assume the barcode data = 001234567890
- 0 + 2 + 4 + 6 + 8 + 0 = 20
- 20 * 3 = 60
- 0 + 1 + 3 + 5 + 7 + 9 = 25
- 60 + 25 = 85
- 85 + X = 90 (nearest equal or higher multiple of 10), therefore X = 5 (checksum)
Here is a sample Visual Basic function to calculate the checksum:
Function Append_EAN_Checksum (RawString as String)
Dim Position as Integer
Dim CheckSum as Integer
CheckSum = 0
For Position = 2 to 12 step 2
Checksum = Checksum + Val(Mid$(RawString, Position, 1))
CheckSum = CheckSum * 3
For Position = 1 to 11 Step 2
CheckSum = CheckSum + Val(Mid$(RawString, Position, 1))
CheckSum = CheckSum Mod 10
CheckSum = 10 - CheckSum
If CheckSum = 10 Then
CheckSum = 0
Append_Ean_Checksum = RawString & Format$(CheckSum, "0")
Many countries have EAN coding authorities which regulate the use of retail barcodes.
For names, addresses, and telephone numbers, check our list of standards organizations.
In the United States the UPC-A and UPC-E symbologies are used for marking retail
products; the administering authority is the Uniform Code Council in Dayton, Ohio (tel.
The USA has begun the process of moving to the EAN-13 symbol, which will be known as
the UPC-13 symbol in the USA. Existing UPC-A codes do not
have to be changed, but new identification numbers issued will follow the UPC-13 format.
This means that imported products labeled with EAN-13 codes do not have to be re-labeled
for USA retail sale. The official date by which all retail scanning systems must
accept the EAN-13 code is January 1, 2005.