mAIbmAIbTools

Credit Card Validator (Luhn)

Check whether a card number passes the Luhn checksum and detect its brand — all in your browser.

Numbers are never sent anywhere — checked locally with the Luhn algorithm.

How to use

  1. Type or paste a card number (spaces are fine).
  2. It's checked against the Luhn formula and the brand is detected.
  3. Use test numbers like 4242 4242 4242 4242.

How the Credit Card Validator (Luhn) works

Checks whether a card number is structurally valid using the Luhn checksum, and identifies the issuing network from its prefix.

The Luhn algorithm doubles every second digit from the right, subtracts 9 from any result above 9, sums everything, and passes if the total is divisible by 10. The network comes from the leading digits.

double every 2nd digit from the right, subtract 9 if > 9, sum, then check sum mod 10 == 0

Worked example

4532015112830366 passes the checksum and starts with 4, so it is identified as Visa.

Things worth knowing

Frequently asked questions

Does Luhn mean the card is real?

No — Luhn only checks the number is well-formed. It doesn't confirm the card exists or has funds.

Is my card number stored?

No — validation runs entirely in your browser and nothing is transmitted.

Why does Luhn exist?

To catch the mistakes humans actually make — single mistyped digits and transposed adjacent pairs — before a transaction is attempted.