We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Generate test bank and credit card numbers that pass the Luhn algorithm validation. Supports major card networks including Visa, Mastercard, and UnionPay.
Click "Generate card numbers" to see results
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
This generator produces numeric test strings in selected Visa, Mastercard, or UnionPay patterns and calculates a Luhn check digit. These are synthetic examples for local form validation, demonstrations, and test fixtures. They are not numbers assigned to issued payment accounts, and the generator does not look up an account, issuer, balance, expiration date, or security code.
A Luhn check digit is a simple arithmetic check on the digits in a number. Passing that check means only that the string satisfies the checksum calculation; it does not establish that a card exists, is active, belongs to a person, or can authorize a payment. A format check and a payment authorization are different operations.
For gateway integration, use the payment provider’s documented sandbox values and test environment. For example, Stripe’s testing documentation explains provider-specific test cards and expected test behavior. A random number produced here is not a substitute for those values.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Choose Visa, Mastercard, or UnionPay. The selection controls the prefix and length pattern used by the generated values. UnionPay outputs can vary in length; Visa and Mastercard outputs use the patterns configured by this generator.
Enter how many numbers you need. The available maximum can depend on your account tier, and the quantity field is constrained to the current limit. Turn on the unique-only option when you need each result in the current batch to be distinct.
Select Generate to replace the result list. The page also generates a small default set when the selected network changes. Use the copy control to copy the displayed list for your local form checks or fixture file.
When unique-only is enabled, generation uses a bounded number of attempts. For very large requests, the returned list may contain fewer numbers than requested if it cannot find enough distinct values within that limit.
Use cases
See how the tool fits into real work and everyday tasks.
Paste a generated value into a development form to check digit filtering, length handling, formatting, and a local Luhn check. Keep this test away from a live payment submission.
Use a synthetic value to demonstrate how a check digit can catch some entry errors. Explain that a successful arithmetic check says nothing about an issued account or payment approval.
Store the output in a clearly labeled test fixture for UI or parser tests. For end-to-end checkout behavior, switch to the processor’s own sandbox and its published test values.
Q&A
Find concise answers to common questions and confusing cases.
No. The output is generated test data, not an issued payment account, and is not for purchases, account registration, subscriptions, or live checkout attempts.
It means only that the digits pass that checksum. It does not verify issuer assignment, account status, cardholder identity, expiration, security code, or authorization.
Use the gateway’s own test environment and its documented test values. Arbitrary values from a Luhn generator may pass a local form check but do not represent provider-specific test outcomes.
Unique-only mode stops after a bounded number of attempts. If it does not find enough distinct outputs in that time, the result count can be below the requested count.
Notes
Review scope, result limitations, and important precautions before use.
Do not submit generated numbers to a live checkout, use them to impersonate a payment account, or try them against a real service. Use synthetic values only in systems you own or are authorized to test. A passing Luhn calculation is a formatting check, not proof of a valid payment credential or permission to transact. Provider sandbox behavior should be tested with that provider’s documented test values.
Related
Discover related tools, collections, and available API capabilities.