# What is the check digit?

Works out the check digit of a number with the Luhn, GS1 (UPC, EAN, ISBN-13), ISBN-10 or ISO 7064 MOD 97-10 method, or checks whether a full number has the right one.

- Page: https://www.acalculator.org/logic/check-digit-calculator
- JSON spec: https://www.acalculator.org/logic/check-digit-calculator.json
- Version: 80da0f05a9ea

## Default answer

Example with the default inputs (Method Luhn (mod 10): cards, IMEI, I want to Make the check digit, Number 7992739871): 7992739871: Check digit 3: 79927398713.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| m | Method | The check digit method the number uses. |
| do | I want to | Make the check digit for a number, or check a full number that ends in its check digit. |
| n | Number | The digits, without the check digit to make one, or with it to check one. Spaces and hyphens are ignored. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| result | Answer | The check digit and the full number, or whether the full number is valid. |
| digit | Check digit | The check digit the payload needs (two digits for MOD 97-10; X stands for 10 in ISBN-10). |
| full | Full number | The payload followed by its check digit. |
| valid | Valid | In check mode: whether the last digit (or two) is the right check digit. |

## Method

Luhn: double every second digit from the right of the payload (subtract 9 from results over 9), sum, check = (10 − sum mod 10) mod 10. GS1: weights 3, 1, 3, … from the right of the payload, check = (10 − sum mod 10) mod 10. ISBN-10: weights 2 to 10 from the right, check = (11 − sum mod 11) mod 11, 10 written X. MOD 97-10: check = 98 − (payload × 100 mod 97), two digits.

## Assumptions

- Spaces and hyphens are ignored; every other character must be a digit (X only as the last ISBN-10 character).
- In check mode the last digit (the last two for MOD 97-10) is the check digit.
- A valid check digit catches typing slips; it does not show that a card, product or book exists.

## Worked examples

1. m = luhn, do = make, n = 7992739871 gives digit = 3, full = 79927398713, result = Check digit 3: 79927398713. Source: Wikipedia, "Luhn algorithm" (example 7992739871, check digit 3), https://en.wikipedia.org/wiki/Luhn_algorithm (retrieved 2026-10-05).
2. m = gs1, do = make, n = 03600024145 gives digit = 7, full = 036000241457. Source: Wikipedia, "Check digit", UPC example 036000241457, https://en.wikipedia.org/wiki/Check_digit (retrieved 2026-10-05).
3. m = gs1, do = check, n = 978-0-7475-3269-9 gives valid = Yes, digit = 9, result = Valid. Source: Wikipedia, "Check digit", ISBN-13 example 978-0-7475-3269-9, https://en.wikipedia.org/wiki/Check_digit (retrieved 2026-10-05).
4. m = isbn10, do = check, n = 0-201-53082-1 gives valid = Yes, digit = 1. Source: Wikipedia, "Check digit", ISBN-10 example 0-201-53082-1 (weighted sum 99 = 9 × 11), https://en.wikipedia.org/wiki/Check_digit (retrieved 2026-10-05).
5. m = isbn10, do = make, n = 080442957 gives digit = X, full = 080442957X.
6. m = mod97, do = check, n = 3214282912345698765432161182 gives valid = Yes, digit = 82, result = Valid. Source: Wikipedia, "International Bank Account Number" (GB82 WEST 1234 5698 7654 32; W = 32, E = 14, S = 28, T = 29, G = 16, B = 11), https://en.wikipedia.org/wiki/International_Bank_Account_Number (retrieved 2026-10-05).

## FAQ

### What is a check digit?

A check digit is an extra digit worked out from the other digits of a number and put at its end. When someone types the number wrong, the check digit usually no longer fits, so the slip is caught before it does harm.

### How do I calculate a Luhn check digit?

From the right of the number (without the check digit), double every second digit, starting with the last one. If a doubled digit is over 9, subtract 9. Add all the digits. The check digit is what you add to reach the next multiple of 10. For 7992739871 the sum is 67, so the check digit is 3.

### How is a UPC or EAN check digit worked out?

GS1 numbers (UPC, EAN, ISBN-13, GTIN and SSCC) weight the digits 3, 1, 3, 1 and so on from the right of the number without the check digit. Add the products; the check digit takes the sum up to the next multiple of 10. For the UPC 03600024145 the sum is 53, so the check digit is 7.

### Why does an ISBN-10 sometimes end in X?

The ISBN-10 check digit works modulo 11, so it can be 10. One digit cannot show 10, so the Roman numeral X is used. ISBN-13 uses the GS1 method instead, whose check digit is always 0 to 9.

### Does a valid check digit mean a card number is real?

No. A check digit only shows the number is well formed. A card, product, or book can have a valid check digit and still not exist, and a check digit cannot tell you who owns an account.

### What is MOD 97-10?

It is a method from ISO 7064 that gives two check digits: append 00 to the number, take the remainder by 97, and subtract it from 98. IBANs use it after moving the country code and check digits to the end and turning letters into numbers.

## Sources

- Wikipedia, "Luhn algorithm": the method and the example 7992739871 with check digit 3. https://en.wikipedia.org/wiki/Luhn_algorithm (retrieved 2026-10-05)
- Wikipedia, "Check digit": UPC-A (036000241457), ISBN-10 (0-201-53082-1) and ISBN-13 (978-0-7475-3269-9) methods and examples. https://en.wikipedia.org/wiki/Check_digit (retrieved 2026-10-05)
- Wikipedia, "International Bank Account Number": ISO 7064 MOD 97-10 check digits, 98 minus the remainder. https://en.wikipedia.org/wiki/International_Bank_Account_Number (retrieved 2026-10-05)
- Wikipedia, "ISBN": ISBN-10 weights 10 to 1 and the check character X. https://en.wikipedia.org/wiki/ISBN (retrieved 2026-10-05)
