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 identifies 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 USA has begun the process of moving to the EAN-13 symbol, 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 were required to accept the EAN-13 code was January 1, 2005.
The Uniform Code Council (registrar for the USA) and the European Article Numbering organization (registrar for the rest of the world) have merged into a single organization: GS1. Visit their website and click on the Contact link to find the office for any country in the world.
The checksum (last digit in the barcode) is a Modulo 10 calculation:
Example: Assume the barcode data = 001234567890
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)) Next Position CheckSum = CheckSum * 3 For Position = 1 to 11 Step 2 CheckSum = CheckSum + Val(Mid$(RawString, Position, 1)) Next Position CheckSum = CheckSum Mod 10 CheckSum = 10 - CheckSum If CheckSum = 10 Then CheckSum = 0 End If Append_Ean_Checksum = RawString Format$(CheckSum, "0") End Function