How EAN-13 Barcodes and Their Check Digit Work
An EAN-13 barcode is more than black bars: the final digit is a check that catches common typing mistakes.
What is the Barcode Generator?
Enter 12 digits and the tool calculates the EAN-13 check digit, builds the full 95-module bar pattern using the standard left, guard and right encodings, and draws the bars on a canvas in the browser. A 13-digit input is checked instead of being rebuilt, and a mismatching check digit is reported. This tool covers EAN-13 only, not other barcode formats.
How to use it
- Enter the first 12 digits of the product code
- Generate the barcode and check the full 13-digit result
- Download the image and test it with a scanner
Worked example
400638133393 gives check digit 1, full code 4006381333931, a 95-module pattern and a downloadable barcode image.
Why does a barcode end with a check digit?
Because the check digit is calculated from the other twelve digits, a single mistyped digit usually makes the total fail the check, so scanners and stock systems can spot the error.
Frequently asked questions
How is the check digit worked out?
Digits in odd positions count once and digits in even positions count three times; the check digit is what brings that total up to the next multiple of ten.
Can I use this for any product?
Only if the code is meant to be EAN-13. Other formats use different encodings and are not produced here.