← Hashito System Home 日本語 Tools Blog
Input & settings

About check digits

How the calculation works

Each digit is multiplied by a fixed weight and summed, then the final single digit is chosen so that the total becomes a multiple of 10. For EAN-13, the 12-digit body is multiplied by weights of 1, 3, 1, 3, and so on, and the check digit is the value obtained by subtracting the ones place of that sum from 10 (0 if the result is 10).

Should I enter just the body or the full number?

Either works. If you enter the body without the check digit (12 digits for EAN-13), it calculates the verification digit. If you enter the full number (13 digits), it recalculates from everything but the last digit and judges whether the last digit you entered is correct.

When is Luhn used?

Luhn (modulus 10) is a method used to verify credit card numbers, IMEIs, and similar. Starting from the rightmost digit, every other digit is doubled, and if doubling produces a two-digit number the digits are added together (or 9 is subtracted); the total is summed and the check digit is chosen so the total becomes a multiple of 10. The number of digits is not fixed.

Frequently asked questions (FAQ)

What is a check digit?

A check digit is a single verification digit appended to the end of a number to detect input errors. Because it is derived from the preceding digits using a fixed formula, mistyping any digit makes the calculation no longer match, so the error can be caught. It is used in JAN/EAN barcodes, ISBN, credit card numbers, and more.

Do EAN-13 and credit cards use different calculation methods?

Yes, they differ. EAN-13/JAN and ISBN-13 multiply the odd and even positions by weights of 1 and 3, sum them, and take the complement to 10. UPC-A reverses the weights to 3 and 1. Credit cards and similar use the Luhn (modulus 10) method, doubling every other digit from the right and subtracting 9 when the result exceeds 9 before summing. This tool automatically switches to the correct calculation when you select a method.

Is the number I enter sent to a server?

No. All calculation is completed entirely in JavaScript within your browser. The number you enter is never sent to or stored on any server.