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

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.
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.
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.
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.
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.
We use cookies to measure traffic and improve the site (Google Analytics), and may show ads later. Nothing is enabled without your consent. Privacy policy