# how to calculate the check digit (EAN-13) barcode symbologies ?

• 08-05-2009, 09:15 AM
hwkong1688
how to calculate the check digit (EAN-13) barcode symbologies ?
Hi all friends,

(1 textbox and 1 command button)

pls help me write the code in VB6 into command button click event, when i click the command button the barcode and check digit will show on the textbox.

EXAMPLE
How to calculate the Check Digit
A check digit is the result of a mathematical calculation performed on the preceding digits in the number. It is used during scanning to verify that the barcode was correctly read.

This calculation, called the Modulo 10 algorithm, is the same for all GS1 primary identification numbers.

An example calculating the check digit
8 9 0 4 0 0 0 2 1 0 0 3 C (check digit position)

Perform the following calculation using the GTIN - 13 numbers from the example above.

1.Starting with the first number on the right, add all the alternate numbers
2. 3 + 0 + 2 + 0 + 4 + 9 = 18

3.Multiply the result by three.
18 x 3 = 54

4.Starting with the second number on the right, add all alternate numbers.
0 + 1 + 0 + 0 + 0 + 8 = 9

5.Add the results of steps two and three.
54 + 9 = 63

6.Add the number needed to bring the total to the next multiple of 10.
63 + 7 = 70

The number which you need to add to make it the next multiple of 10 is the check digit.

In our example the check digit is 7.

The complete number is: 890 4000 21003 7

thank u.

:confused::confused:
• 08-06-2009, 09:19 AM
hwkong1688
Resolved!!
thank all..
:)
• 08-10-2009, 05:44 PM
Tutankhamun-bg
Every number has a WEIGHT...
890400021003?

8 9 0 4 0 0 0 2 1 0 0 3
8*1 + 9*3 + 0*1 + 4*3 + 0*1 + 0*3 + 0*1 + 2*3 + 1*1 + 0*3 + 0*1 + 3*3
8 + 27 + 0 + 12 + 0 + 0 + 0 + 6 + 1 + 0 + 0 + 9 = 63
We must add 7 to make 63 evenly divisible by 10 (63 + 7 = 70), therefore the check digit is 7.
• 03-30-2012, 05:45 AM
jeffery8273
This EAN13 Barcode Control is able to automatically calculate the check digits.
• 02-17-2013, 05:08 AM
Thomassunshine
Try this SDK:Barcode Generator for .NET
.NET Barcode Generation SDK is able to generate and create over 20 linear, postal & 2D barcodes, including QR Code, Data Matrix, PDF-417, Code 39, Code 128, EAN 13, GS1 128, Intelligent Mail, UPC-A, etc in accordance with the latest barcode specification in ISO or GS1 system.
And the check digit will be calculated automatically.
• 02-18-2013, 07:56 AM
Hack
The question deals with Classic VB. A .NET solution isn't going to work for that platform.
• 06-21-2013, 04:13 AM
dannydog
you can google barcode generator and you will find many useful tools, or google "how to create EAN-13 barcode" to get instructive articles. i usually do such kind of work related to barcode generation so i can give you some advices. i am using an imaging sdk to generate barcode ,including EAN-13 barcode. Advanced EAN 13 barcoding SDK, built in .NET framework 2.0 is employed by the sdk , so if you don't have a better choice, you can have a try.
• 08-05-2013, 03:48 AM
loveseaosn
Quote:

you can google barcode generator and you will find many useful tools, or google "how to create EAN-13 barcode" to get instructive articles. i usually do such kind of work related to barcode generation so i can give you some advices. i am using an imaging sdk to generate barcode ,including EAN-13 barcode. Advanced EAN 13 barcoding SDK, built in .NET framework 2.0 is employed by the sdk , so if you don't have a better choice, you can have a try.

You are right. Last time I wanted a barcode generator and I fond it through Google. Make full use of Google.
• 01-14-2014, 02:25 AM
makaveiljojo
I think you guys have twisted the post. It's about the calculation of the EAN 13 check digit.

EAN-13 is self-checking with one mandatory check digit that can be calculated from 12 encodable characters. Below is an example of EAN-13 checksum digit calculation:
The encoded data is "690875397621".

690: stands for a country code
8753: stands for the manufacturer code
97621: stands for the product code

The process of checksum calculation is as follows:

Sum of numbers in odd position (O): 6 + 0 + 7 + 3 + 7 + 2 = 25
Sum of numbers in even position (E): 9 + 8 + 5 + 9 + 0 + 1 = 32
Then: O * 3 + E = 25* 3 + 32= 107
10 - 7 = 3
Thus, its checksum is 3 and this barcode data with check digit should be "6908753976213".
Hope it'll help.
• 05-26-2014, 04:07 AM
arronlee
Hi, Makaveiljojo.
Thanks for your nice sharing. I do believe using a
barcode reader to deal with the related EAN-13 barcoding projects can make all the process much more convenient. I am totally a green hand on this field. Any suggestion will be appreciated. Thanks in advance.

Best regards,
Arron