Tools
PDF Tools 34
Image Tools 5
AI Writing 13
Text Tools 13
SEO and websites 22
YouTube and video 13
Calculators and converters 17
Developer Tools 13
Other tools 2
Scanner Blog
Language

Card Number Validator (Luhn)

Check whether a bank card number is correctly formatted using the Luhn algorithm.

The check runs in your browser with the Luhn algorithm; the number is not sent to our server.

Related tools

All tools in this group
Illustration of a card number checked with the Luhn algorithm and shown as valid

One wrong digit is enough to get a payment declined

When you type a sixteen-digit card number, one wrong digit, or two neighbouring digits swapped, is enough for the payment to be declined. That is why every card number ends with a check digit, worked out from the other digits with the Luhn algorithm. Jood's card number validator repeats that calculation and tells you whether the number you typed is consistent.

How to use it

  1. Type the number in the "Card Number" field. Spaces and dashes are fine: the tool keeps only the digits.
  2. Click "Start Now".
  3. The result appears: "The number is valid according to the Luhn algorithm." or "The number is not valid: the last digit does not match the others.", along with the network and the number of digits.

The tool accepts 12 to 19 digits. It recognises the network from the first digits: Visa starts with 4, American Express with 34 or 37 and has 15 digits, Mastercard starts with 51 to 55 or with 2221 to 2720. If the number of digits does not match what the network normally uses, the tool points it out.

How does the Luhn algorithm work?

Start from the last digit, the one on the right, and leave it as it is. Double the digit before it, leave the next one, and keep alternating up to the first digit. If doubling gives more than 9, subtract 9: a 7 becomes 14, then 5. Then add up all the digits. If the total can be divided by 10, the number is valid.

A short example to show the idea: in 4242 you leave the final 2, double the 4 to get 8, leave the 2, and double the first 4 to get 8. The total is 20, so the check passes. With 4243 the total would be 21 and the check would fail. This method catches any error in a single digit and almost every swap of two neighbouring digits, except 09 written as 90.

What the check cannot tell you

A valid number is not necessarily a real card. The check does not contact any bank, so it cannot know whether the card exists, has expired, has money on it or whose name is on it. It only catches typing mistakes, and the tool reminds you of that under every valid result.

Your number stays on your device

The check runs in your browser, and the number is not sent to our server. Even so, you do not need your real card to try out a payment form you are building: the Test Card Number Generator creates numbers that pass this check and cannot be used for any payment.