Skip to content
100% local

Test card number generator

Generate fake payment card numbers with a valid Luhn checksum for testing forms.

Output

Test card number generator

This tool generates fictional payment card numbers that pass the Luhn (mod 10) checksum — the same structural check every real card validator runs — so you can test checkout forms, payment integrations and client-side validation without touching a real card. Every number is fabricated: it carries no funds, is tied to no account and cannot be charged. Use it whenever a staging environment, a QA script or a form demo needs something that looks and validates like a card number without being one.

Pick a brand — Visa, Mastercard, American Express, Discover or JCB — and the generator produces numbers with that brand's published prefix (IIN) and length, so brand-detection logic in your form gets exercised too. Set how many to generate at once, choose whether the digits print grouped in fours like a physical card or run together continuously, and optionally add a random future expiry date and a CVV (four digits for Amex, three for the rest). Output as a plain list, one card per line, or as CSV with a header row ready to paste into a spreadsheet or a test fixture file.

The check digit is computed for real using the Luhn algorithm, not picked at random, so results are structurally indistinguishable from a genuine card number to any validator that only checks the checksum and format — which is the point. No prefix here is looked up against a real issuer's BIN range, and nothing is ever transmitted anywhere to verify it against an actual account.

Everything runs locally in your browser using the Web Crypto API for randomness. Nothing you generate is uploaded or logged anywhere. Copy the result, download it as a .txt file, clear it and start over, or send the output straight into another tool's input to keep testing.

FAQ

Can these numbers be used to make a real purchase?
No. Every number is fabricated for testing and carries no funds, no linked account and no cardholder. It only satisfies the Luhn checksum and the brand's prefix and length — nothing more.
Why does the check digit matter?
Most card forms reject a number immediately if its Luhn checksum fails, before any other validation runs. A random last digit would fail that check about 90% of the time, so it is computed for real.
How does the tool pick which brand a number belongs to?
Each brand has a published prefix range and total length — Visa starts with 4, Amex with 34 or 37, and so on. The generator uses those same public ranges, the ones a real validator checks against.
Are the expiry date and CVV realistic?
The expiry date is a random month one to five years in the future, formatted MM/YY, and the CVV is three random digits (four for Amex) — both plausible in shape but not tied to any real card.
Is my generated data uploaded anywhere?
No. Generation happens entirely in your browser using the Web Crypto API. Nothing is sent to a server, logged or stored anywhere outside your device.