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
- Choose a card brand such as Visa, Mastercard, Amex or Discover.
- Press Generate to create a fake, Luhn-valid number.
- Copy the number into your test payment form.
- 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
Password Generator
Generate strong, random passwords online. Choose length, letters, digits, symbols and skip look-alike characters. Created in your browser, never stored.
Random Number Generator
Generate random numbers in any range online. Set a min, max and count, pick unique values, and copy the results. Secure and runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base32 Encode
Base32 encode and decode text online using the standard RFC 4648 alphabet with proper padding. UTF-8 safe, fast and private in your browser.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.