Calculate the correct check digit for UPC-A, EAN-13, EAN-8 or ITF-14, or paste in a full number to check whether it's valid.
UPC-A, EAN-13, EAN-8 and ITF-14 all use the same underlying method (a "modulo 10" or "Luhn-style" weighted checksum), just with different digit counts. Starting from the rightmost digit and working left, each digit is alternately multiplied by 3 and by 1, the results are summed, and the check digit is whatever number needs to be added to bring that sum up to the next multiple of 10.
This means a single mistyped or misprinted digit — or two digits swapped — will almost always produce a sum that doesn't reach a clean multiple of 10, which is exactly what lets a scanner detect the error instead of silently recording the wrong product.
If you're assembling barcode numbers manually — say, generating a range of internal product codes in a spreadsheet — you can calculate the correct trailing check digit for each one here before feeding the full numbers into the barcode generator or bulk generator. If you already have a full number from somewhere else and want to confirm it's valid before printing, use the validator instead.