On a payment card, the check digit is the last digit, calculated from all the digits before it. Type those digits and the calculator returns the Luhn check digit, which almost every card uses.
The digit is there to catch typing mistakes. Here's how it works, what it catches, and which numbers use other rules.
Double every second digit, starting from the right
The Luhn method takes four steps. Here they are on 1234567, a made-up number, worked from its right-hand end:
- Double every second digit, beginning with the last. So 7, 5, 3 and 1 become 14, 10, 6 and 2.
- If doubling gives 10 or more, add the two digits: 14 counts as 5 and 10 as 1.
- Add up all seven results: 5 + 6 + 1 + 4 + 6 + 2 + 2 = 26. This is the Luhn sum the calculator shows.
- The check digit lifts the sum to the next multiple of 10. From 26 to 30 takes 4, so the full number is 12345674.
Adding a doubled digit's two digits gives the same result as subtracting 9: 14 − 9 = 5. In a correct number, the Luhn sum plus the check digit always ends in 0: 26 + 4 = 30.
Testing a number you already have
This calculator works out a check digit; it doesn't grade a finished number. So leave off the last digit when you type. If the answer matches the digit you left off, the number passes.
Typing the whole number is an easy slip. The calculator then treats every digit as input and answers for a longer number.
Spaces and dashes don't matter. The calculator skips anything that isn't a digit, so "7091 553" and "7091553" give the same result. Grouping helps you proofread, too. The Baymard Institute, which studies checkout design, calls errors in a 16-digit unformatted string "needlessly difficult" to spot.
Which typing mistakes it catches, and which slip through
In a doubled spot, no two digits count the same:
So any single wrong digit changes the last digit of the sum, and the check digit stops fitting. Here's the calculator's answer for 7091553, whose check digit is 3, and for five mistyped versions:
| Digits typed | Check digit | Luhn sum |
|---|---|---|
| 7091553 (correct) | 3 | 27 |
| 7091558 (last digit wrong) | 2 | 28 |
| 7091535 (neighbors 5 and 3 swapped) | 0 | 20 |
| 7901553 (0 and 9 swapped) | 3 | 27 |
| 7051953 (9 and 5 swapped, two apart) | 3 | 27 |
| 7091223 (55 typed as 22) | 3 | 27 |
Any row still showing 3 is a mistake the check digit can't see. Swapping two neighbors is usually caught, because one of them moves into a doubled spot. The exception is 0 and 9: doubled, 9 still counts as 9 and 0 as 0.
Two other slips are invisible. Digits two places apart sit in the same kind of spot, so swapping them leaves the sum unchanged. And 55 typed as 22 adds 6 either way: 1 + 5 or 4 + 2.
A passing number isn't a real card
The check digit shows only that the digits agree with each other. Anyone can make a number that passes: type any digits here and the calculator supplies a last digit that fits.
So a card number that passes might belong to nobody. Whether an account exists, is open or has money in it isn't something the digits can tell you.
Weighing up a card rather than its number? The credit card calculator shows the monthly payment and interest to clear a balance. The credit utilization calculator divides your balances by your credit limits.
Cards and US health provider numbers use Luhn
Payment cards are the best-known case. According to Baymard, Luhn validation applies to all cards except some China UnionPay cards and Diners Club enRoute. The last of those is no longer active.
The US also uses it for the National Provider Identifier (NPI), the number that identifies health care providers. Under federal rules, the NPI has 10 digits, with a check digit in the 10th position.
The 2004 rule that adopted it says the check digit uses "the ISO standard Luhn check digit algorithm." But it's calculated as if the NPI began with 80840, the prefix for US health applications on ID cards.
| Digits entered | Check digit | Luhn sum | Digits processed |
|---|---|---|---|
| 123456789 (made-up NPI, first nine digits) | 7 | 43 | 9 |
| 80840 123456789 (same, with prefix) | 3 | 67 | 14 |
The rule mentions a constant for when the prefix is left off, without giving it. The table shows it: the prefix adds 24 to the Luhn sum, 67 − 43. It always sits in the same places, so it adds 24 to any NPI.
To check an NPI here, type 80840 followed by its first nine digits. The made-up NPI above would end in 3, making 1234567893.
Not every check digit is Luhn
Other numbers follow other rules, and this calculator can't check them. Your car's vehicle identification number (VIN) is one: under federal rules, its ninth character is a check digit.
The VIN method gives each character a value and multiplies it by a weight for its position. The products are added and divided by 11, and the remainder sets the check digit. So it can be 0 to 9 or the letter X.
A Luhn tool gives a meaningless answer for a VIN; this one even drops the letters.
Sources
- Federal Register, HIPAA Administrative Simplification: Standard Unique Health Identifier for Health Care Providers, final rule (January 23, 2004)
- eCFR, 45 CFR 162.406, Standard unique health identifier for health care providers (as of September 23, 2026)
- eCFR, 49 CFR Part 565, Vehicle Identification Number Requirements (as of September 24, 2026)
- Baymard Institute, Credit Card IIN Ranges and Spacing Patterns (last updated January 15, 2020)