A secure testing tool for payment system developers and QA professionals. All test numbers are non-functional and strictly for development environments.
Example: 79927398713 passes the check โ the processed digits sum to 70.
Change any single digit and the sum will no longer be divisible by 10.
function isValidLuhn(number) {
const digits = number.replace(/\D/g, '');
let sum = 0;
let double = false;
for (let i = digits.length - 1; i >= 0; i--) {
let digit = Number(digits[i]);
if (double) {
digit *= 2;
if (digit > 9) digit -= 9;
}
sum += digit;
double = !double;
}
return sum % 10 === 0;
}
def is_valid_luhn(number: str) -> bool:
digits = [int(c) for c in number if c.isdigit()]
total = 0
for index, digit in enumerate(reversed(digits)):
if index % 2 == 1:
digit *= 2
if digit > 9:
digit -= 9
total += digit
return total % 10 == 0
A number can pass Luhn and still be invalid: the BIN may not exist, the length may be wrong for the network, or the card may simply not be issued. Luhn only detects accidental errors such as typos. For a full check, combine it with the BIN checker, and for practice numbers use the test card generator.
Generate test cards from any BIN
Wildcard patterns & bulk output
Official numbers from gateway docs
Check if a card number is valid
Identify the card network from a BIN
Visa test numbers starting with 4
Mastercard test numbers 51โ55 / 2221โ2720
American Express 15-digit test numbers
Discover test numbers 6011 / 65
Estimate credit card interest
Plan your monthly payoff
Payment testing guides & tutorials