✅ Luhn Check Validator — Card Number Checksum

Paste a number to test the Luhn checksum used by payment cards and some ID schemes. Spaces and dashes are ignored. Nothing is uploaded.

Validators Free · no sign-up Reviewed 2026-11-03
Input
Result
Details

Private by design. This tool runs entirely in your browser — nothing you enter or add is uploaded to any server.

What this tool does

The Luhn validator checks whether a number satisfies the Luhn checksum, the mod-10 formula used by most payment cards, IMEI numbers and some account identifiers. It also reports the digit count, the check digit and a rough prefix hint such as Visa-like or Mastercard-like.

The algorithm starts from the rightmost digit, doubles every second digit, subtracts 9 from any result above 9, and adds everything together. If the total is a multiple of 10, the number passes. Because the check digit is part of the calculation, changing any single digit or swapping two adjacent digits almost always causes a failure, which makes the check useful for catching typing mistakes.

A passing checksum does not mean a card is valid, active or chargeable. It only means the digits are internally consistent. Anyone can invent a number that passes the Luhn check, and the prefix hint is a pattern match rather than an issuer lookup. Never enter a real card number into a website you do not control; use the published test numbers instead.

When to use it

  • Check a test card number while building a payment form.
  • Catch a mistyped digit before submitting an account number.
  • Teach how the mod-10 checksum works with a worked example.
  • Verify that a sample IMEI passes its checksum.
  • Sanity-check a number copied from a document.

How it works

  1. Spaces and dashes are stripped so only digits remain.
  2. The Luhn algorithm doubles every second digit from the right and sums the digits.
  3. A total divisible by 10 is valid. A brand hint is inferred from the prefix only.

Worked example

Check 4111 1111 1111 1111, a standard Visa test number. After removing spaces it has 16 digits. Doubling every second digit from the right and reducing values above nine produces a sum that is a multiple of 10, so the validator reports a valid checksum. Change the last digit to 2 and the sum is no longer divisible by 10, so 4111 1111 1111 1112 fails. The prefix hint for the valid number is "Visa-like", but that is only a pattern, not proof of an account.

  • 4242424242424242 is a common Visa-format test number and passes Luhn.
  • 4242424242424241 fails because the check digit is wrong.
  • Dashes in 3782-822463-10005 are ignored before the checksum.

Accuracy and limitations

  • The Luhn check validates format only. It cannot confirm that a card exists, is active, has funds or belongs to the person entering it.
  • The prefix hint is a simple regular expression for common card networks and does not identify the issuer or card type reliably.
  • Numbers from 2 to 19 digits are accepted, so non-card identifiers that use Luhn can also be checked, but other lengths are rejected.
  • It does not perform expiry, CVV or address verification, and it must never be used as the only validation on a payment form.

Privacy and data handling

Validation runs locally in your browser and the number is not transmitted. Despite that, only paste real card details into systems you are authorised to use; prefer official test numbers for development.

Frequently asked questions

Does a passing check mean the card is real?

No. Luhn only checks the checksum. It cannot confirm that an account exists, is funded, or is not stolen.

Is the number sent to a server?

No. The check runs in your browser and the field is not submitted anywhere.

Does a Luhn pass mean the card is valid?

No. It means the digits satisfy a checksum. Authorisation by the issuer is the only way to know whether a card can be charged.

Why do some valid numbers fail?

Not every identifier uses Luhn, and some cards or regional systems use different check rules. A failure is a strong hint of a typo, but context matters.

Can I use this to validate an IMEI?

Yes, IMEI numbers use the Luhn formula. Enter the 15 digits without spaces and check whether the checksum passes.