Calculate the final Luhn digit.
Initialising algorithm engine for Credit Card Check Digit Calculator...
How Credit Card Check Digit Calculator Works?
The Credit Card Check Digit Calculator works by applying the Luhn algorithm to the first 15 (or 13–18) digits of a Primary Account Number (PAN) and appending the digit that makes the full number pass the Luhn test.
- 1Enter the card number without its last digit.
- 2Double the rightmost digit and every second digit to the left.
- 3Subtract 9 from any doubled result above 9.
- 4Add the transformed card digits to get S.
- 5Append (10 − (S mod 10)) mod 10 as the final digit.
Credit Card Check Digit Calculator Formula
The credit card check digit formula is Check = (10 − (Luhn sum mod 10)) mod 10, as defined in ISO/IEC 7812-1.
S = Σ f(dᵢ), f doubles every second digit from the right (starting with the rightmost payload digit) Check = (10 − (S mod 10)) mod 10 (CREDIT CARD)
dᵢare the PAN digits without the check digit.
Luhn sum S = 29 Check = 1 PAN = 4111 1111 1111 1111
Credit Card Check Digit Calculator Conversion Table
The credit card conversion table lists card brands with their Issuer Identification Number (IIN) prefixes and public test numbers.
| Brand | IIN prefix | Payload | Check digit | Test PAN | Length |
|---|---|---|---|---|---|
| Visa | 4 | 411111111111111 | 1 | 4111111111111111 | 16 |
| Mastercard | 51–55, 2221–2720 | 555555555555444 | 4 | 5555555555554444 | 16 |
| American Express | 34, 37 | 37828224631000 | 5 | 378282246310005 | 15 |
| Discover | 6011, 65 | 601111111111111 | 7 | 6011111111111117 | 16 |
| JCB | 3528–3589 | 353011133330000 | 0 | 3530111333300000 | 16 |
| Diners Club | 36, 38 | 3056930902590 | 4 | 30569309025904 | 14 |
| UnionPay | 62 | 620000000000000 | 5 | 6200000000000005 | 16 |
Payment processors publish these test numbers. Each number passes the Luhn test and links to no real account.
What is Credit Card Check Digit Calculator?
A Credit Card Check Digit Calculator is a tool that computes the last digit of a payment card number with the Luhn algorithm. The last digit of every Visa, Mastercard, American Express, and Discover card is a Luhn check digit.
The check digit confirms correct typing only. Card validity depends on the expiry date, the card verification value (CVV), and issuer authorisation.
What are the uses of Credit Card Check Digit Calculator?
There are 3 main uses of the Credit Card Check Digit Calculator, including test card creation, checkout development, and teaching.
- Test card creation: QA teams build Luhn-valid numbers for sandbox environments.
- Checkout development: Developers test card field validation logic.
- Teaching: Instructors show how card numbers detect typos.