Boneyard Tools

Test Credit Card Number Generator

Generate fake but Luhn-valid card numbers to test checkout flows, validation and storage. These are dummy numbers for developers only. They are not real cards and cannot be used to buy anything.

How to generate a test card number

  1. Choose a card brand such as Visa, Mastercard, Amex or Discover.
  2. Press Generate to create a fake, Luhn-valid number.
  3. Copy the number into your test payment form.
  4. Generate as many as you need for your test cases.

Examples

Visa test number

brand: Visa
4xxx xxxx xxxx xxxx (16 digits, Luhn valid)

Amex test number

brand: American Express
3xxx xxxxxx xxxxx (15 digits, Luhn valid)

Mastercard test number

brand: Mastercard
5xxx xxxx xxxx xxxx (starts 51-55)

Frequently asked questions

Are these real credit card numbers?

No. Every number is completely fake. It is randomly generated to match a brand's prefix and length and to pass the Luhn check, but it is not linked to any account, has no funds and cannot be used for any real purchase.

What are these test numbers for?

They are for developers. Use them to test payment forms, client-side validation, field formatting and database storage without touching a live card. For end-to-end gateway testing, use the sandbox card numbers your payment provider documents.

What does Luhn valid mean?

The Luhn algorithm is a simple checksum that most card validators run first to catch typos. A Luhn-valid number passes that check, which is why these dummy numbers are useful for exercising form validation.

Can I get in trouble for using these?

Generating fake numbers for testing your own software is a normal developer task. Attempting to use any card number you are not authorized to use for a real transaction is fraud. These numbers carry no value and cannot complete a purchase.

Is anything sent to a server?

No. Numbers are generated locally in your browser, so nothing is uploaded and the tool works offline.

Related tools