Sales

Check Digit Calculator

Enter a number without its check digit to compute the Luhn check digit.

  • Free
  • No sign-up
  • Updated for 2026

Your number

Enter a number to compute its check digit.

Worked example

With these example inputs:

  • Number (without check digit)7992739871

Check digit: 3

  • Luhn sum67
  • Digits processed10

Add this calculator to your site

Free to embed. Copy the snippet below, it drops the live calculator straight into any page.

The last digit that checks the rest

Card numbers, IMEI codes and many account identifiers end in a digit that is not part of the identifier at all. It is computed from the others so that a single mistyped character produces an invalid number rather than a valid one belonging to someone else.

The Luhn algorithm

check digit = (10 − (sum mod 10)) mod 10

Working right to left across the number, double every second digit. Where doubling gives a two-digit result, add the two digits together. Sum everything, then find the digit that brings the total to a multiple of ten.

Worked example: 7992739871

  • Weighted sum: 67
  • Next multiple of ten: 70
  • Check digit: 70 − 67 = 3
  • Complete number: 79927398713

What it catches, and what it misses

Error typeCaught?
Any single mistyped digitAlways
Two adjacent digits swappedAlmost always
Swapping 0 and 9 when adjacentNo
Two separate digits both wrongSometimes

Those two exceptions are the known limits of the algorithm. It was designed in 1954 to catch human transcription errors cheaply, not to resist deliberate forgery.

Where you meet it

Every payment card in circulation, IMEI numbers on mobile phones, Canadian social insurance numbers, and a large share of loyalty and account identifiers. It is also the reason a card form can tell you a number is wrong before contacting any bank.

That check happens in the browser, in a fraction of a second, and it removes the majority of typing errors before they reach a payment network.

It is not a security measure

Passing the Luhn check means a number is well formed. It says nothing about whether the account exists, has funds, or belongs to the person entering it.

Generating numbers that pass is trivial — the algorithm is public and this page performs it. Validation of an actual card requires the issuer, and no arithmetic on the number alone can substitute for it.

Card numbers carry more than the check digit

The first digit identifies the industry: 4 for Visa, 5 for Mastercard, 3 for travel and entertainment cards. The first six to eight digits are the issuer identification number, which routes the transaction to the right bank. The digits between that and the check digit are the account itself.

Other check digit schemes

Luhn is the most common but not the only one. ISBNs use a weighted modulo 11 that can produce a check character of X. IBANs use modulo 97 across the whole rearranged string, which catches more error types than Luhn at the cost of more computation.

Barcodes use modulo 10 with weights of 3 and 1 rather than doubling alternate digits. Each was chosen for the error profile of how its numbers get transcribed — spoken aloud, typed, or scanned.

Why the check happens before the network sees it

Validating in the browser costs nothing and rejects most typing errors instantly. Sending them to a payment network instead would cost a fee per attempt and slow the form down for everyone.

It also improves the error message. A form that says the number is invalid the moment you finish typing is more useful than one that waits, submits, and returns a generic decline that could mean a dozen different things.

Related calculators

Frequently asked questions

How does the Luhn algorithm work?

Starting from the right, every second digit is doubled and digits over nine have nine subtracted, then all are summed. The check digit is whatever makes that total a multiple of ten. For 7992739871 the check digit is 3.

Where is it used?

The Luhn formula validates credit card numbers, IMEI numbers and many ID and barcode schemes. It catches most single-digit typos and many transposition errors.