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.
On this page15 sections
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 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.
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.
A worked example using the Luhn checker
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.
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.
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 type | Typical length | Notes |
|---|---|---|
| Credit / debit card (PAN) | 13–19 digits | Visa, Mastercard, Amex and most networks; last digit is the Luhn check digit |
| IMEI (phone identifier) | 15 digits | The 15th digit is a Luhn check over the first 14 |
| SIM card ICCID | 19–20 digits | Luhn check digit at the end |
| CUSIP / financial IDs | 9 digits | Securities identifiers use a Luhn-style check |
| National ID numbers | varies | Canadian 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.
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.
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 type | Caught? |
|---|---|
| Any single wrong digit | Yes — always |
| Most swaps of two adjacent digits | Yes |
| Transposing "09" to "90" (or "90" to "09") | No |
| Twin swaps: 22↔55, 33↔66, 44↔77 | No |
| Two or more separate wrong digits | Sometimes — 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.
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.
Luhn algorithm definitions
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.
Frequently asked questions about the free Luhn Algorithm (Card Check) calculator
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.