Developer Tools calculator

Free Luhn Algorithm (Card Check) calculator

Paste a credit-card, IMEI, or other identification number and this Luhn algorithm checker tells you whether it passes the mod-10 checksum, shows the computed checksum, and finds the missing check digit — updated live, as you type.

InputsLive
What do you want to do?
Example or your own
Number to checkdigits only; spaces and dashes ignored
Result
Valid — passes the Luhn check
Valid
The weighted digit sum is 80, divisible by 10 — the format checks out.
Digits16
Checksum80
Checksum mod 100

Validates number format only — never whether a card is real or active. Nothing you type is stored or sent; the check runs in your browser.

Results are estimates. Consult a professional.

How it works

How the Luhn algorithm works

The Luhn algorithm is a checksum that tells you whether a number was typed correctly. Hans Peter Luhn designed it at IBM in 1954, and it now guards credit-card numbers, IMEI numbers and many ID numbers. It works by weighting the digits, adding them up, and checking whether the total lands on a multiple of ten. If it does, the number passes; if not, a digit is wrong.

The checker above runs the math live as you type. Paste a number, and it reports three things: whether the number is valid, the checksum it computed, and the check digit that would complete a partial number. Spaces and dashes are ignored, so a card written as 4539 1488 0343 6467 is read the same as the bare digits.

Format only — not a real-card check
A "valid" result means the digits are internally consistent, the way a correctly typed number should be. It does not mean the card exists, is active, or has funds. Luhn checks the shape of the number, nothing more.
The formula

The Luhn formula, step by step

The whole algorithm is four steps. Start at the rightmost digit and move left. Double every second digit. If doubling gives a two-digit result, subtract nine (the same as adding the two digits). Sum every digit. The number is valid when that sum divides evenly by ten.

from the right: double digits in positions 2, 4, 6, …
if a doubled digit > 9, subtract 9
checksum = sum of all digits
valid when checksum mod 10 = 0
The Luhn algorithm ("modulus 10" or "mod 10") is specified in ISO/IEC 7812-1, the standard for identification card numbering. It was patented by Hans Peter Luhn (US Patent 2,950,048, 1960) and is in the public domain.
Example

A worked example using the Luhn checker

Example: checking the number 79927398713

This is the textbook Luhn example. We will run the eleven-digit number 79927398713 through the four steps by hand, then confirm it against the checker.

Step 1 — Double every second digit from the right

The rightmost digit (3) is position 1 and stays. Moving left, double positions 2, 4, 6, 8 and 10. So the digits 1, 8, 3, 2 and 9 (reading from the right) become 2, 16, 6, 4 and 18.

Step 2 — Subtract 9 from any doubled digit over 9

16 → 16 − 9 = 7, and 18 → 18 − 9 = 9. The doubled values are now 2, 7, 6, 4 and 9.

Step 3 — Add every digit

Sum the doubled-and-reduced digits with the untouched ones: the total comes to 70. That is the checksum the calculator shows.

Step 4 — Check divisibility by ten

70 mod 10 = 0, so the number is valid. Try it: the checker reports a checksum of 70 and a "Valid" result for 79927398713.

Checksum 70 — valid
Change any single digit and the checksum stops landing on a multiple of ten — that is exactly the typing mistake Luhn is built to catch.
Check digit

How to compute the Luhn check digit

The last digit of a Luhn number is not random — it is the check digit, chosen so the whole number passes. If you have a number without its check digit (the "payload"), the calculator works out which final digit to append.

Take the payload 7992739871 — the same example number with its last digit removed. Because appending a digit shifts the doubling pattern by one place, you double from the rightmost payload digit, sum, then compute (10 − (sum mod 10)) mod 10. The result is 3, which appended gives 79927398713 — the valid number from the example above.

double the payload from its rightmost digit
sum all the resulting digits
check digit = (10 (sum mod 10)) mod 10
Where it's used

What numbers use the Luhn algorithm?

Luhn is everywhere a number gets typed or read aloud and a quick sanity check helps. It is not a security feature — it is a typo filter — so it appears wherever a single wrong digit would cause a costly mistake.

Number typeTypical lengthNotes
Credit / debit card (PAN)13–19 digitsVisa, Mastercard, Amex and most networks; last digit is the Luhn check digit
IMEI (phone identifier)15 digitsThe 15th digit is a Luhn check over the first 14
SIM card ICCID19–20 digitsLuhn check digit at the end
CUSIP / financial IDs9 digitsSecurities identifiers use a Luhn-style check
National ID numbersvariesCanadian SIN, Israeli, South African and Swedish IDs, among others

Lengths and uses follow ISO/IEC 7812-1 and published numbering schemes. Not every ID uses Luhn — always confirm the scheme for your number type.

Limits

What the Luhn check does not tell you

This is the part most quick checkers skip, and it is the most important. A passing Luhn check is a low bar. It confirms the digits hang together; it says nothing about whether the number belongs to a real, active account.

  • It does not mean the card is real. Anyone can generate a Luhn-valid number that no bank ever issued. Payment processors run Luhn first, then check the issuer's real records.
  • It does not mean the card is active or funded. Only the card network can confirm status, balance, or whether a charge will go through.
  • It is not security. Luhn is a public, keyless formula. It catches honest typos, not fraud — a thief with a stolen number passes it every time.
  • It only handles digits. Alphanumeric identifiers fall outside the algorithm.
A first filter, not a verdict
Treat a "valid" result as "worth submitting to the next system," not as "confirmed." Real verification needs the issuer or network — which is exactly why this page never tries to contact one.
Payment processors note that Luhn "can verify that a sequence of numbers is potentially valid, but it cannot determine if it corresponds to a legitimate account or identity," and should not be relied on alone for security-critical checks.
Error detection

Which errors Luhn catches — and which it misses

Luhn was designed against the mistakes people actually make when copying a number: a wrong digit, or two neighbours swapped. It catches most of them, but a few slip through, and knowing the blind spots is part of using it well.

Error typeCaught?
Any single wrong digitYes — always
Most swaps of two adjacent digitsYes
Transposing "09" to "90" (or "90" to "09")No
Twin swaps: 22↔55, 33↔66, 44↔77No
Two or more separate wrong digitsSometimes — not guaranteed

Detection coverage per the Luhn algorithm specification (ISO/IEC 7812-1) and Wikipedia's analysis of the algorithm.

These gaps are why Luhn is a first line of defence, not the only one. For high-stakes numbers, systems pair it with a full lookup against the issuer's records.

Privacy

Is this Luhn checker safe to use?

Yes. The check runs entirely in your browser using plain arithmetic. The number you type is never stored, logged, or sent to any server — there is no network request, because none is needed. The formula is self-contained, so the page works the same offline.

That said, a real credit-card number is sensitive data. Because Luhn only checks format, there is rarely a reason to paste a live card here — a test number demonstrates the algorithm just as well. Use the built-in test card or IMEI examples when you only want to see how the check behaves.

Definitions

Luhn algorithm definitions

The single number you get after weighting and summing all the digits. When the checksum is divisible by ten, the number passes the Luhn check.
The final digit of a Luhn number, chosen so the whole number is valid. The calculator can derive it for a payload that has no check digit yet.
The remainder after dividing by ten — the heart of the Luhn test. A valid number has a checksum whose mod-10 value is zero. "Mod 10" is another name for the algorithm itself.
The full number printed on a payment card, 13 to 19 digits long. Its last digit is the Luhn check digit; the digits before it identify the network and issuer.
The 15-digit International Mobile Equipment Identity that uniquely names a phone. Its 15th digit is a Luhn check over the first fourteen.
The international standard for identification-card numbering, which specifies the Luhn check digit. It defines how the numbers on cards are structured and validated.
Accuracy

How accurate is this Luhn calculator?

The math is exact. The checksum, the validity result and the check digit are computed by the same rules in the ISO/IEC 7812-1 specification, so the calculator agrees with any correct Luhn implementation digit for digit. There is no rounding and no estimate involved.

What stays outside its reach is reality. The calculator can tell you a number is well-formed; it cannot tell you the account exists, is active, or will accept a charge. That answer lives only with the card network or issuer. Use this page to catch typos and to understand the algorithm — and use the issuer's own systems to confirm a number is truly good.

Questions

Frequently asked questions about the free Luhn Algorithm (Card Check) calculator

A luhn Algorithm (Card Check) calculator is a free online tool that helps you validate a credit-card, IMEI, or other ID number with the Luhn (mod-10) checksum, and compute the missing check digit. The Luhn (mod-10) algorithm is a checksum that catches typos in identification numbers. From the rightmost digit, double every second digit; if a doubled value exceeds 9, subtract 9; sum all digits. The number is valid when the total is divisible by 10. It runs entirely in your browser with instant results and no sign-up.
No. Luhn checks only that the digits are internally consistent — the way a correctly typed number should be. It cannot confirm the card exists, is active, or has funds. Only the card network or issuer can verify that. Anyone can generate a Luhn-valid number no bank ever issued.
Take the number without its final digit (the payload), double it from the rightmost digit, sum the results, then compute (10 − (sum mod 10)) mod 10. Switch the tool to "Find the check digit" mode and it does this for you — for example, payload 7992739871 needs a check digit of 3.
Credit- and debit-card numbers (PANs), 15-digit IMEI phone identifiers, SIM ICCIDs, CUSIP securities IDs, and several national ID numbers (Canadian SIN, Israeli, South African, and Swedish IDs, among others). The last digit is usually the Luhn check digit.
It detects every single-digit error and most swaps of adjacent digits, but it misses transposing 09 to 90, and the twin swaps 22↔55, 33↔66, and 44↔77. That's why it's a first typo filter, not a full verification.
The check runs entirely in your browser using plain arithmetic — the number is never stored, logged, or sent anywhere. Still, because Luhn only checks format, there's rarely a reason to paste a live card; a test number demonstrates the algorithm just as well.
About

About this Luhn Algorithm (Card Check) calculator

This Luhn algorithm checker runs entirely in your browser. The number you enter is never stored, logged, or sent to any server — the mod-10 math is computed locally, so the tool works the same offline. It validates format only: a passing result means the digits are consistent, not that a card is real, active, or issued.

Looking for more developer utilities? Browse the rest of our dev tools calculators, or see the full library on the all calculators page.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.