If this tool helped you, you can buy us a coffee ☕
生成符合Luhn算法的测试用银行卡号,支持Visa、MasterCard、银联等主流卡组织格式
Click "Generate card numbers" to see results

Chinese RMB Amount Converter
Accurately convert between numeric amounts and Chinese uppercase/lowercase financial characters to meet formatting standards for Chinese contracts, invoices, and banking.

Return on Investment (ROI) Calculator
Enter your investment amount and dates to quickly calculate ROI and annualized return, helping you make smarter investment decisions.

FVIFA Calculator
Calculate the Future Value Interest Factor of an Annuity (FVIFA) instantly. Enter your interest rate and periods to estimate the future value of regular investments with this free online calculator.
When developing payment features, you may need hundreds or thousands of correctly formatted bank card numbers to test form validation, but you must never use real user card numbers. Our generator creates virtual test card numbers that comply with the Luhn algorithm, ensuring safety and compliance. These generated numbers pass primary format validation in banking systems but have no corresponding real accounts. They are strictly for non-transactional scenarios like software testing and educational demonstrations. We currently support three major card networks: Visa, Mastercard, and UnionPay, allowing you to generate up to 100 card numbers at a time.
The core validation rule for bank card numbers comes from the Luhn algorithm (also known as the "modulus 10" or "mod 10" algorithm). Proposed by Hans Peter Luhn in 1954, it is still used by global payment networks today to detect accidental errors in card number entries. The principle is simple: starting from the rightmost digit (the check digit), multiply every second digit by 2. If the result is 10 or greater, add the two digits of the product together (which is equivalent to subtracting 9). Then, add all these numbers together. If the total sum is divisible by 10, the card number passes validation. The brilliance of this design is that it catches most single-digit transcription errors and adjacent digit transpositions with minimal computational overhead, making it perfect for real-time execution on point-of-sale terminals and web pages.
Let's select Visa, set the quantity to 1, and click generate. Suppose the resulting card number is 4929123456789012 (this will vary randomly in actual use). These 16 digits can be broken down into three parts: the first 6 digits, 492912, represent the Bank Identification Number (BIN), indicating it is a Visa card; digits 7 through 15 are a randomly generated personal account identifier; and the final digit, 2, is the Luhn check digit.
Let's validate it manually: take the first 15 digits, 492912345678901. Moving from right to left, multiply the digits in the even positions (15th, 13th... 1st) by 2, resulting in the sequence 8, 9, 4, 9, 2, 4, 10, 14, 18, 8, 14, 12, 6, 12, 2; subtract 9 from any number greater than 9, which becomes 8, 9, 4, 9, 2, 4, 1, 5, 9, 8, 5, 3, 6, 3, 2. Add these to the un-doubled digits in the odd positions (14th, 12th... 2nd), which are 2, 1, 3, 5, 7, 9, 0: 8+2+9+1+4+3+9+5+2+7+4+9+1+0+5+9+8+3+6+3+2 = 108. Since 108 is divisible by 10, the validation passes, meaning 2 is the correct check digit.
By comparison: selecting Mastercard will generate a 16-digit card number starting with 51–55, such as 5323456789012345; selecting UnionPay will generate a 16-digit card number starting with 62, such as 6223456789012345. You can easily identify the test card's network by its prefix.
Every 16-digit string you receive is not entirely random. The first 6 digits strictly follow the BIN range of the corresponding card network, allowing any card reading system to instantly identify whether it's a Visa or UnionPay card. The middle 9 digits are a randomly generated personal account identifier, and the final digit is automatically calculated from the first 15 digits using the Luhn algorithm. The typical characteristics of different card networks are summarized below:
| Card Network | Prefix (BIN Range) | Generated Length |
|---|---|---|
| Visa | 4 | 16 digits |
| Mastercard | 51–55 | 16 digits |
| UnionPay | 62 | 16 digits |
You can copy the generated card numbers into any tool that supports Luhn validation, and they will always pass. However, please note: these card numbers do not contain real banking information, nor do they have expiration dates or CVV codes. They only solve the problem of being "format valid."
Common Pitfalls: