Test card number generator. Luhn-valid, never chargeable.
Generate Luhn-valid test numbers with correct brand prefixes and lengths for Visa, Mastercard, Amex, Discover, JCB and Diners Club — plus a validator for any number. Everything runs in your browser; nothing is uploaded or stored.
A free online tool by Digital HeroesFor developer & QA testing only. These numbers are mathematically valid — they pass the Luhn checksum and use real brand prefixes — but they are NOT real cards: they aren't linked to any account, can't make purchases, and can't be charged. That checksum-and-prefix similarity is exactly why payment sandboxes and test gateways accept them for form validation. Using generated numbers for real transactions is fraud, and it won't work anyway.
Generated entirely in your browser — nothing is sent anywhere or stored.
Why do these numbers “work” in test forms?
Card forms usually validate three things before talking to a bank: the brand prefix (IIN — Visa starts with 4, Amex with 34/37), the length (15 for Amex, 14 for Diners, 16 for most), and the Luhn checksum — a mod-10 check digit invented in 1954 to catch typos. This tool generates numbers that satisfy all three, which is why sandboxes and front-end validators accept them. A real charge still requires an issuing bank to recognize the account — which these numbers don't have. Free forever, runs offline once loaded.
Complete test data, zero risk.
- Generate test numbers for 6 major brands — Visa, Mastercard, American Express, Discover, JCB and Diners Club — with correct IIN prefixes and lengths, or a mixed random batch.
- Pick the digit length per brand (e.g. Visa 13/16/19) and format numbers with spaces, dashes, or no separator.
- Create 1 to 100 at once with optional future expiry dates, CVVs (4-digit for Amex) and fake holder names to fill every payment-form field.
- Copy line by line or all at once, or export the batch as CSV or JSON for test suites, fixtures and CI pipelines.
- Validate any card number — live Luhn check, automatic brand detection and a length-sanity flag, one number per line.
- Private by construction: generation and validation run entirely on your device; nothing is uploaded or stored.
Five steps, no manual.
- Pick a card brand (or Mixed), a digit length and a formatting style from the dropdowns.
- Set the count slider and tick the boxes for expiry, CVV and holder name if you need them.
- Click Generate — Luhn-valid numbers appear instantly.
- Copy individual lines, Copy all, or download the batch as CSV or JSON.
- Switch to the Validate tab to check any card numbers against Luhn and detect their brand as you type.
Frequently asked questions.
Are these real credit card numbers?
Is the Test Card Number Generator free?
Is it private? Are the numbers uploaded anywhere?
Why do the numbers pass checkout form validation?
Can I validate a card number without generating one?
Does it work offline?
Published · Last updated .