Test Credit Card Number Generator

Luhn-validated test 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

How It Works

  1. 1

    Pick a Card Type

    Visa, MasterCard, Amex, Discover, JCB - or Random Mix if you need variety.

  2. 2

    Generate

    Set quantity (1-100), choose your format, hit Generate. Luhn-validated numbers appear instantly. All client-side.

  3. 3

    Copy or Export

    Copy to clipboard or export as CSV, JSON, or Playwright format. Ready for your tests.

Use Cases

  • E-commerce Testing

    Checkout flows, payment forms, cart functionality. Valid numbers that 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.

Technical Details

Luhn Algorithm

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.

Luhn Validation ExampleTypeScript
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 TypePrefix (IIN)LengthCVV Length
Visa416 digits3 digits
MasterCard51-55, 2221-272016 digits3 digits
American Express34, 3715 digits4 digits
Discover6011, 644-649, 6516 digits3 digits
JCB3528-358916 digits3 digits

Frequently Asked Questions

No. These are synthetic test card numbers - not connected to any bank or financial institution. They're for development and testing only. Payment processors reject them in production.
A checksum formula that validates credit card numbers. Created by Hans Peter Luhn at IBM in 1954. It catches typos and transposition errors by doubling every second digit, summing them, and checking if divisible by 10. Every card number we generate passes Luhn validation.
Yes. Randomly generated, follows valid patterns, not linked to real accounts. Use them for payment forms, validation logic, staging environments - anything that needs realistic card data without real money involved.
Five major networks: Visa (starts with 4), MasterCard (51-55 or 2221-2720), American Express (34 or 37), Discover (6011, 644-649, or 65), and JCB (3528-3589). Correct length, CVV format, and valid Luhn checksum for each.
TypeScript objects ready for Playwright end-to-end tests. Card number, CVV, expiry, cardholder name - copy-paste directly into your test files.
Any automation tool that handles payment forms: Playwright, LambdaTest, Selenium, Cypress. Use CSV or JSON export for any framework.
1 to 100 cards. Most testing scenarios need 10-20 for variety. Everything runs client-side in your browser - no API limits, no rate restrictions, no data sent anywhere.

Need Full Payment Flow Testing?

Test card numbers are just the start. Bug0 runs AI-powered end-to-end tests on your entire checkout flow. Payment forms, error states, edge cases - automated.

Ship fast. Break nothing. - Bug0 AI-powered QA automation