Skip to content
§
§ · free tool

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 Heroes

For 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.

5

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.

§ 02 · what you can do

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.
§ 03 · how to use it

Five steps, no manual.

  1. Pick a card brand (or Mixed), a digit length and a formatting style from the dropdowns.
  2. Set the count slider and tick the boxes for expiry, CVV and holder name if you need them.
  3. Click Generate — Luhn-valid numbers appear instantly.
  4. Copy individual lines, Copy all, or download the batch as CSV or JSON.
  5. Switch to the Validate tab to check any card numbers against Luhn and detect their brand as you type.
§ 04 · faq

Frequently asked questions.

Are these real credit card numbers?
No. They are mathematically valid — correct brand prefix, length and Luhn checksum — but they aren't linked to any bank account, can't make purchases and can't be charged. They exist purely for developer and QA testing; attempting to use one for a real transaction is fraud and will fail anyway.
Is the Test Card Number Generator free?
Yes — completely free for everyone. No sign-up, no account and no usage limits.
Is it private? Are the numbers uploaded anywhere?
No upload, ever. Generation and validation both run entirely in your browser on your own device — numbers you generate or paste never leave your computer and nothing is stored.
Why do the numbers pass checkout form validation?
Payment forms typically check three things before contacting a bank: the brand prefix (IIN), the number length, and the Luhn mod-10 checksum. Generated numbers satisfy all three, so sandboxes and front-end validators accept them — but a real charge still needs an issuing bank to recognize the account, which these numbers don't have.
Can I validate a card number without generating one?
Yes. Switch to the Validate tab and paste one or more numbers, one per line. Each line gets a live Luhn verdict, detected brand and a length check, plus a summary count — and you can copy the full results.
Does it work offline?
Yes — once the page has loaded, generating, validating and exporting all run locally in your browser, so the tool keeps working without a connection.

Published · Last updated .

Online now

Hi there. How can we help you today?

Reply