Credit Card Generator: Free Test Card Numbers

Credit Card Generator

Generate realistic test credit card numbers with valid Luhn checksums for development and testing purposes.

These are fictitious card numbers generated using the Luhn algorithm. They cannot be used for real transactions.
Visa
•••• •••• •••• ••••
Card Holder
YOUR NAME
Expires
••/••

This credit card generator creates fake credit card numbers for testing. Pick Visa, Mastercard, American Express, Discover or JCB, click Generate, and you get a Luhn-valid card number with a cardholder name, expiry date, CVV and address. It is built for developers and QA testers who need dummy data for checkout forms. The numbers cannot make real purchases.

What Is a Test Credit Card Number?

A test credit card number is a made-up number that follows the same structure as a real card but is not tied to any bank account, credit line or person. Developers use these numbers to fill in payment forms, check input validation and demo a checkout without touching real money.

Every card number has a recognizable structure:

  • Prefix: the first digits show the card network. Visa numbers start with 4, Mastercard with 51 to 55, American Express with 34 or 37, Discover with 6011, and JCB with 3528 to 3589.
  • Length: Visa, Mastercard, Discover and JCB numbers have 16 digits. American Express numbers have 15.
  • Check digit: the last digit is calculated from the others using the Luhn algorithm, so a typo is easy to catch.

How does the Luhn check work?

The Luhn algorithm is a simple checksum that tells a form whether a number could be valid. Starting from the digit next to the check digit and moving left, you double every second digit. If doubling gives a result above 9, you subtract 9. You add everything up, and the check digit is whatever brings the total to a multiple of 10.

The Luhn check only proves a number is correctly formed. It does not prove the card exists, has funds or belongs to anyone. That is why generated numbers pass format validation but fail any real authorization.

How to Use the Credit Card Generator

Using the generator takes a few seconds, and you do not need an account. Follow these steps:

  1. Find the Select Card Type label and click one of the buttons: Visa, Mastercard, Amex, Discover or JCB. The card preview at the top updates with the network name and logo.
  2. Click the Generate button. The preview card fills in with a number, a cardholder name and an expiry date.
  3. Click Flip card if you want to see the back of the card, where the CVV is shown.
  4. Scroll to Generated Card Details. You will see Card Number, Cardholder Name, Expiry, CVV, Type, Address, Country and ZIP Code.
  5. Use the small copy button beside a single field, or click Copy All to grab the whole set at once.
  6. Open Recent Generations to look back at cards you made earlier in your session. Click Generate again any time for a fresh card.

The tool produces one card per click. If you need ten different cards for a test run, click Generate ten times and copy each one as you go.

Worked Example: Generating an American Express Test Card

Say you are building a checkout page and need to confirm that it accepts 15-digit American Express numbers with a 4-digit security code. You select Amex and click Generate.

The result follows the Amex rules: the number starts with 34 or 37, it has 15 digits, and the CVV has 4 digits instead of 3. You also get a name, an expiry date, a street address, a country and a ZIP code, so you can fill in billing fields too.

If your form rejects the number, you have found a real bug. A form that only allows 16 digits or a 3-digit CVV would wrongly block American Express customers.

A hand-worked Luhn example

To see why the check digit exists, take the payload 7992739871. Working from the right, double every second digit: 1 becomes 2, 8 becomes 16 (so 7), 3 becomes 6, 2 becomes 4, and 9 becomes 18 (so 9). The undoubled digits are 7, 9, 7, 9 and 7. The total is 2 + 7 + 7 + 9 + 6 + 7 + 4 + 9 + 9 + 7 = 67. To reach 70, you need 3, so the full number is 79927398713. The generator does this arithmetic for the digits it creates, so the finished number passes the check.

How to Read and Use the Results

Each field in the results panel maps to a field you will usually find on a payment form. Here is what to do with each one.

  • Card Number: paste it into the card field. If a form shows a network logo as you type, check that it matches the type you picked.
  • Cardholder Name: a random first and last name for the name-on-card field.
  • Expiry: a month and year to paste into the expiry field. Always confirm your form reads the format you expect, such as MM/YY.
  • CVV: 3 digits for most networks and 4 for American Express.
  • Type: the network you chose, handy when you log test cases.
  • Address, Country and ZIP Code: sample billing details for address verification fields and form layout checks.

What a good test result looks like

A well-built form accepts the number, shows the right network icon, applies the right length and CVV rules, and moves on to the next step. A form that fails the number for a valid length and prefix usually has a validation bug. Remember that a form passing format checks is the only thing the generated number proves.

What a poor result tells you

If an American Express number is cut off at 16 digits or the form demands 3 CVV digits, fix the length and CVV rules for that network. If the card icon does not change when you switch from Visa to Mastercard, review how your form detects the prefix. If a JCB number is called invalid, your prefix list may be missing the 3528 to 3589 range.

When Should You Use a Credit Card Generator?

A credit card generator is the right choice any time you need realistic payment data and no real card should be involved. Common situations include:

  • Front-end form testing: checking that card fields format spaces, limit length and show the correct network logo.
  • Validation logic: confirming your own Luhn check accepts good numbers. You can then confirm the same numbers with the Credit Card Validator.
  • Demos and screenshots: filling a checkout mockup without showing anyone's real card.
  • Teaching: showing students how card prefixes, lengths and check digits work.
  • Test data for databases: creating sample customer records. Pair these with checked contact details from a bulk email validator when you build a mock list.

Other utilities in the same family live in the online calculators and utilities category, which is useful when you are assembling a set of everyday developer helpers.

Best Practices and Troubleshooting

Test data is only useful when you use it for the right job. These habits save time and avoid confusion.

Use your payment processor's own test cards for sandbox charges

Payment processors publish a short list of official test card numbers for their sandbox environments. A sandbox usually accepts only those specific numbers, and it simulates outcomes such as approved, declined or insufficient funds. A random Luhn-valid number may be rejected there even though the format is right. Use this generator for form and validation testing, and use the processor's documented numbers when you need a simulated charge.

Why does my generated card say declined?

Because it is not a real card. A decline from a live or sandbox gateway is expected, since no bank issued the number. The generator makes numbers that look right, not numbers that exist.

Match the CVV length to the card type

If your test fails on the CVV field, check the network. American Express uses 4 digits, and every other type in this tool uses 3. Do not hard-code a 3-digit rule for all cards.

Do not expect PINs, links or statements

People searching for how to generate a credit card PIN, payment link or statement are looking for something different. Those are actions you take with your own bank or card issuer, usually in its app or customer service channel. This tool does not create PINs, accounts, payment links or statements. It produces only the sample card details listed above.

Never use these numbers to deceive

Do not use generated numbers to try to buy goods, sign up for free trials under false pretenses or get around payment checks on someone else's site. The numbers have no value in real transactions, and using them to mislead a merchant is not testing. Keep their use to your own forms, staging sites and learning projects.

Limitations and Accuracy Notes

The generator produces fictitious data only, so it has a few clear limits. Numbers are random and are not linked to a real bank, so they cannot pass real authorization, address verification or 3-D Secure checks. Names, addresses and ZIP codes are sample values, and an address may not match the country shown, so do not rely on them for address-matching logic.

The tool supports five networks: Visa, Mastercard, American Express, Discover and JCB. If you need another network, such as a debit scheme or a regional card, you will have to build those test numbers another way. It generates one card each time you click Generate, rather than a large batch file.

Because each number is random, you cannot count on getting the same card twice. If you need to reuse a card, copy it or find it in Recent Generations before you leave the page.

Generate Your Test Card Now

The fastest way to test a checkout form is to have realistic, correctly formatted card data ready to paste. Choose a card type above, click Generate, copy the details, and then run the number through the card validator if you want to confirm the checksum. If you also need scannable codes for a retail mockup, the barcode generator makes a good next stop.

Frequently Asked Questions

How to generate credit card numbers that work?
Choose a card type, click Generate, and the tool builds a number with the right prefix, length and Luhn check digit. It will pass format checks in forms, but it will not work for real payments because no bank issued it.
Are the generated credit card numbers real?
No. Every number is fictitious and tied to no bank, account or person. The credit card generator only makes numbers that look correctly formatted, so they cannot buy anything and cannot pass a real authorization.
What is a credit card generator Luhn check?
The Luhn check is a checksum on the last digit of a card number that catches typos. This generator calculates that digit for you, so each number passes a Luhn test. You can confirm it with a card validator.
Which card types can I generate?
You can generate Visa, Mastercard, American Express, Discover and JCB. Each follows its own prefix and length rules: American Express has 15 digits and a 4-digit CVV, while the other four types have 16 digits and a 3-digit CVV.
Why does my payment gateway reject a generated card number?
A gateway rejects it because the number is not a real card. Sandbox environments usually accept only their own published test numbers. Use this generator for form and validation checks, and the processor's listed numbers for simulated charges.
Is the credit card generator free, and what details do I get?
Yes, it is free and needs no sign-in. Each click gives you a card number, cardholder name, expiry, CVV, type, address, country and ZIP code. Use Copy All to take every field, or copy one field at a time.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now