Other Tools
Credit Card Generator
Generate sample card numbers that pass the Luhn check, for testing forms and validation code. They are made up: they do not belong to anyone, hold no money and will be declined by any real payment.
How to use it
- Choose the card type and how many.
- Press Generate.
- Copy the list into your test data.
Example
A Visa-style test number starts with 4 and ends with a Luhn check digit.
For testing and education only.
What these numbers are and are not
The numbers pass the Luhn check, a simple checksum that catches mistyped digits, so a form that validates card numbers will accept them. They are not connected to any account and a real payment will be declined. Passing the check says nothing about whether a card exists.
Use proper test cards for payments
If you are testing a payment integration, use the test card numbers published by your payment provider, which behave predictably in its test mode. Never use real card details in test data, and do not use generated numbers to try to buy anything.
How the check digit works
The last digit of a card number is a check digit from the Luhn algorithm. Starting from the right, double every second digit, subtract 9 from any result above 9, add everything up, and a valid number gives a total divisible by 10. The widely published test number 4111 1111 1111 1111 passes: its doubled digits and the rest sum to 30.
That check only catches typing mistakes. It does not show that an account exists, and the generated expiry dates and security codes are random. A form that validates the Luhn check will accept these numbers, but a payment processor will refuse them, which is the point of using them for form testing.
Questions
Can these be used to buy things?
No. They only pass the format check. Real payments need real accounts.
Where do I find proper test cards?
Payment providers publish official test card numbers for their sandboxes; use those for end-to-end tests.
Get practical SEO tips by email
Occasional emails with new guides and tools. Confirm by email first; unsubscribe in one click.