Test Credit Card Number Generator
Generate fake credit card numbers for testing - Luhn-validated temp credit cards for Visa, MasterCard, Amex, Discover, JCB. Export as CSV, JSON, or Playwright format. Runs in your browser - no data sent anywhere.
Generated cards will appear here
Technical Details
How Card Numbers Are Validated
The Luhn algorithm (mod-10) is a checksum formula for validating credit card numbers. Hans Peter Luhn created it at IBM in 1954. Still used everywhere today.
How it works: double every second digit from right to left, sum all digits, check if divisible by 10. Catches typos and transposition errors before they hit your payment processor.
Every card number from this generator passes Luhn validation. Your form validators and payment testing environments will accept them.
function isValidLuhn(cardNumber: string): boolean {
const digits = cardNumber.replace(/\D/g, '').split('').map(Number);
let sum = 0;
for (let i = digits.length - 1; i >= 0; i--) {
let digit = digits[i];
// Double every second digit from right
if ((digits.length - i) % 2 === 0) {
digit *= 2;
if (digit > 9) digit -= 9;
}
sum += digit;
}
return sum % 10 === 0;
}Works With Your Testing Stack
Playwright
Native TypeScript export format ready for your test files.
LambdaTest
Cloud-based cross-browser testing with CSV/JSON exports.
Selenium & Cypress
WebDriver-compatible frameworks via CSV or JSON format.
Custom Scripts
Any test automation tool that needs payment data.
Card Type Identification (IIN/BIN)
| Card Type | Prefix (IIN) | Length | CVV Length |
|---|---|---|---|
| Visa | 4 | 16 digits | 3 digits |
| MasterCard | 51-55, 2221-2720 | 16 digits | 3 digits |
| American Express | 34, 37 | 15 digits | 4 digits |
| Discover | 6011, 644-649, 65 | 16 digits | 3 digits |
| JCB | 3528-3589 | 16 digits | 3 digits |
How It Works
- 1
Pick a Card Type
Visa, MasterCard, Amex, Discover, JCB - or Random Mix if you need variety.
- 2
Generate
Set quantity (1-100), choose your format, hit Generate. Luhn-validated numbers appear instantly. All client-side.
- 3
Copy or Export
Copy to clipboard or export as CSV, JSON, or Playwright format. Ready for your tests.
Use Cases
E-commerce Testing
Test checkout flows and payment forms with fake credit card numbers. These temp credit cards validate correctly but won't charge real accounts.
Payment Gateway Integration
Stripe, PayPal, custom gateways. Verify your integration handles card data correctly before shipping.
CI/CD & Cross-Browser Testing
Test card data for automated end-to-end tests. Integrate with LambdaTest, Playwright, Selenium for cross-browser payment testing.
Form Validation
Different card types, lengths, formats. Make sure your validation logic handles edge cases.
Staging Environments
Realistic payment data for QA and demos. No real card numbers touching your staging DB.
Documentation
Sample data for API docs, training materials, onboarding guides. Safe examples you can publish.
Frequently Asked Questions
Ship faster. Break nothing.
Write tests in plain English. AI runs and self-heals them — no code, no flaky selectors.
AI-powered end-to-end testing. No credit card required.