EAN-13 and UPC-A are the two retail barcode number systems printed on almost every product worldwide. Both end in a mod-10 check digit that scanners use to detect misreads. This free validator auto-detects the type from the length and runs the correct checksum, also showing you the expected check digit when one is wrong.
How it works
Both systems use a weighted modulus-10 check digit, but the weighting is mirrored:
- EAN-13 (13 digits): weight the digits
1, 3, 1, 3, ...from the left (odd positions ×1, even positions ×3). - UPC-A (12 digits): weight the digits
3, 1, 3, 1, ...from the left (odd positions ×3, even positions ×1).
In both cases you sum the weighted digits and the barcode is valid when the total is divisible by 10. To compute a check digit, weight the leading digits and take check = (10 - (sum mod 10)) mod 10.
Example
For the EAN-13 4006381333931, weighting the first 12 digits gives a sum whose mod-10 complement is 1, matching the final digit, so the barcode is valid. A UPC-A such as 036000291452 validates under the mirrored UPC-A weighting and is equivalent to the EAN-13 0036000291452.
If a digit is mistyped, the weighted sum no longer ends in 0 and the barcode is rejected; the tool then shows the correct check digit. All processing is local to your browser.