Test Bank Card Number Generator
Generate Luhn-valid bank card numbers for development and testing, covering Visa, Mastercard, American Express and UnionPay prefixes. The numbers are randomly generated and are strictly for testing - they are not real cards and cannot be used for any real transaction.
FreeOnline Tool
Loading…
How to Use
- Choose the card type: Visa (16 digits), Mastercard (16 digits), American Express (15 digits) or UnionPay (16 digits).
- Choose the display format: space separated groups or plain digits.
- Set how many numbers to generate (1-50) and press "Generate".
- Click any single number to copy it, or press "Copy all" to copy the whole batch at once.
Features
- Follows the prefix rules of four card schemes: Visa, Mastercard, American Express and UnionPay
- Every generated number passes the Luhn (Mod 10) checksum used by real issuers, but the numbers are randomly generated and are not valid issued cards
- Output in either space separated groups or plain digits
- Up to 50 numbers per run, with click-to-copy on a single number or one-click copy of the whole list
Use Cases
Payment flow testing
Feed Luhn-valid test numbers into e-commerce checkouts and payment forms to exercise the ordering and settlement path.
Front-end form validation
Verify that a card number field correctly implements Luhn checking, digit-length rules and display formatting.
Demos and training
Show a card entry screen and its interaction flow without ever touching real cardholder data.
Automated test fixtures
Produce batches of rule-conformant test data to populate API tests and regression suites.
FAQ
Are the generated numbers real, usable bank cards?
No. They are randomly generated and only guaranteed to be structurally valid under the Luhn algorithm. They were never issued by any bank and must never be used for a real transaction.
Which card types are supported?
Visa (16 digits, starting with 4), Mastercard (16 digits, starting 51-55), American Express (15 digits, starting 34 or 37) and UnionPay (16 digits, starting with 62).
What is the Luhn check?
It is a checksum algorithm based on a weighted sum that tells you whether a digit sequence is well formed. The final check digit on major bank cards is calculated with it.
How many numbers can I generate at once?
Between 1 and 50 per run, output either as space separated groups or as plain digits.