Skip to main content
Check Digit Calculator
Banking

Credit Card Check Digit Calculator

Calculate the final Luhn digit for a payment card payload. Follow doubling and digit sums without implying that an account exists.

Last updated:

Banking & Financial Standards

Calculate the final Luhn digit.

Length: 10 chars
Calculated Check Character / Checksum
--Ready
Complete Validated Sequence:
--
Arithmetic Steps & Mathematical Specification

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.

  1. 1Enter the card number without its last digit.
  2. 2Double the rightmost digit and every second digit to the left.
  3. 3Subtract 9 from any doubled result above 9.
  4. 4Add the transformed card digits to get S.
  5. 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.
Worked example: Visa test payload 411111111111111
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.

BrandIIN prefixPayloadCheck digitTest PANLength
Visa44111111111111111411111111111111116
Mastercard51–55, 2221–27205555555555554444555555555555444416
American Express34, 3737828224631000537828224631000515
Discover6011, 656011111111111117601111111111111716
JCB3528–35893530111333300000353011133330000016
Diners Club36, 38305693090259043056930902590414
UnionPay626200000000000005620000000000000516

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.