If you're testing a payment form, building a checkout flow, or running QA on an e-commerce platform, you need Visa test card numbers. Not real ones — valid-format test numbers that pass client-side validation without touching anyone's bank account.
Visa is the world's most widely accepted card network. That means it's also the one your payment integration will encounter most often. Getting Visa test data right isn't optional — it's step one.
This guide covers everything: Visa card structure, official test numbers from every major gateway, how to generate your own with Namso Gen, BIN ranges by issuer and country, and validation rules. Bookmark it. You'll come back.
How Visa Card Numbers Work
Every Visa card number follows a precise structure defined by the ISO/IEC 7812 standard. Understanding it makes you a better tester because you'll know why certain numbers pass validation and others don't.
The Visa Number Structure
| Position | Digits | Purpose |
|---|---|---|
| 1 | 4 |
Major Industry Identifier (MII) — always 4 for Visa |
| 1–6 (or 1–8) | 4XXXXX |
Bank Identification Number (BIN/IIN) — identifies the issuing bank |
| 7–15 | Variable | Account number — unique to the cardholder |
| 16 (last) | Check digit | Calculated using the Luhn algorithm |
Key facts about Visa numbers:
- Always start with 4. If it doesn't start with 4, it's not Visa. Period.
- 16 digits is standard for modern Visa cards. Legacy cards used 13 digits, but those are nearly extinct in the wild.
- Visa Electron cards also start with 4 but use specific BIN ranges (4026, 4175, 4508, 4844, 4913, 4917).
- The check digit (last digit) is calculated via the Luhn algorithm, not random. This is why you can't just make up 16 digits starting with 4 and expect them to pass validation.
BIN Ranges: What the First 6–8 Digits Tell You
The BIN (Bank Identification Number) encodes the issuing bank, card type, and country. Since April 2022, the industry has been transitioning from 6-digit to 8-digit BINs (now called IINs — Issuer Identification Numbers), though 6-digit BINs are still widely used.
For Visa, the BIN always starts with 4. Beyond that:
| BIN Range | Card Type | Notes |
|---|---|---|
| 4000 00–4000 09 | Test/sandbox ranges | Used by gateways like Stripe |
| 4111 11 | Classic test range | The famous 4111 1111 1111 1111 lives here |
| 4012 88 | Gateway test cards | Used by Adyen, PayPal, and others |
| 4026, 4508, 4844, 4913, 4917 | Visa Electron | Debit-specific, common in Europe |
| 4175 00 | Visa Electron (specific) | Regional issuer ranges |
For a deeper dive into BIN structure across all networks, check our complete BIN guide. To look up what bank a specific BIN belongs to, use our BIN Checker.
Official Visa Test Card Numbers by Gateway
Every major payment gateway provides sandbox test cards. Here are the Visa-specific ones you'll use most often.
Stripe
| Card Number | Scenario | CVC | Expiration |
|---|---|---|---|
4242 4242 4242 4242 |
Successful payment | Any 3 digits | Any future date |
4000 0000 0000 0002 |
Card declined | Any 3 digits | Any future date |
4000 0000 0000 9995 |
Insufficient funds | Any 3 digits | Any future date |
4000 0000 0000 0069 |
Expired card | Any 3 digits | Any future date |
4000 0000 0000 0127 |
Incorrect CVC | Any 3 digits | Any future date |
4000 0000 0000 0101 |
CVC check fails | Any 3 digits | Any future date |
4000 0025 0000 3155 |
Requires 3D Secure authentication | Any 3 digits | Any future date |
4000 0000 0000 3220 |
3D Secure 2 authentication | Any 3 digits | Any future date |
Stripe's Visa test suite is the most comprehensive. The 4242 card is the one developers reach for instinctively — it's the "hello world" of payment testing.
PayPal (Braintree Sandbox)
| Card Number | Scenario |
|---|---|
4111 1111 1111 1111 |
Successful transaction |
4000 1111 1111 1115 |
Processor declined |
4012 0000 0000 0009 |
Successful (alternate) |
4012 8888 8888 1881 |
Successful (international format) |
Adyen
| Card Number | Scenario |
|---|---|
4111 1111 1111 1111 |
Successful payment |
4400 0000 0000 0008 |
3D Secure enrolled |
4212 3456 7890 1237 |
Successful (alternate) |
4988 4388 4388 4305 |
Refused |
Square
| Card Number | Scenario |
|---|---|
4532 7153 6285 4521 |
Visa — successful charge |
Checkout.com
| Card Number | Scenario |
|---|---|
4242 4242 4242 4242 |
Successful payment |
4000 0000 0000 0002 |
Declined |
4000 0000 0000 0028 |
Soft decline |
4000 0000 0000 0036 |
3D Secure required |
4000 0000 0000 0044 |
Flagged — risk review |
MercadoPago (Latin America)
| Card Number | Scenario |
|---|---|
4509 9535 6623 3704 |
Visa — approved |
4000 0000 0000 0044 |
Visa — rejected |
Pro tip: Gateway test cards only work in sandbox/test mode. They'll always fail in production. For broader testing — form validation, load testing, BIN-specific scenarios — you need to generate your own. That's where Namso Gen comes in.
Generate Custom Visa Test Cards with Namso Gen
Gateway test cards cover the basics, but real-world testing demands more. What if you need:
- 50 Visa cards for a load test?
- Cards from a specific BIN (say, a Chase Visa or a UK-issued Visa)?
- Cards that match a particular format (16 digits, specific expiry range)?
- Test data for multiple Visa subtypes (Classic, Gold, Platinum, Electron)?
Namso Gen generates Luhn-valid Visa card numbers in bulk. Here's how.
Step 1: Enter a Visa BIN
Go to namso.io and enter a BIN starting with 4. For example:
| BIN | Issuer | Country |
|---|---|---|
411111 |
Generic Visa test BIN | — |
402400 |
Test Visa (sandbox-friendly) | US |
431940 |
USAA Visa | US |
450930 |
Visa Electron | Europe |
476173 |
Chase Visa | US |
421345 |
Santander Visa | UK |
Not sure which BIN to use? Look one up with the BIN Checker or check our BIN guide for common ranges.
Step 2: Configure Generation
- Quantity: Set how many cards you need (1 to hundreds for bulk testing).
- Format: 16 digits is standard for Visa.
- Expiry date: Set a future date, or let Namso Gen randomize it.
- CVV: Generate random 3-digit CVVs (Visa uses 3-digit CVV2, never 4).
Step 3: Generate and Copy
Click Generate. You'll get a batch of Luhn-valid Visa numbers ready to paste into your test environment.
Example output:
4111 1149 7834 2256 | 08/28 | 419
4111 1182 5501 6043 | 03/27 | 753
4111 1127 3998 5110 | 11/29 | 208
4111 1193 0447 8892 | 06/28 | 641
4111 1158 6212 3374 | 01/30 | 527
These numbers pass Luhn validation and look like real Visa cards to any form validator — but they're not connected to any real account.
Visa Card Validation Rules
If you're building or testing payment form validation, here are the rules your code should enforce for Visa:
| Rule | Requirement |
|---|---|
| Prefix | Must start with 4 |
| Length | 16 digits (13-digit legacy cards are effectively obsolete) |
| Luhn check | Last digit must satisfy the Luhn algorithm |
| CVV (CVV2) | 3 digits, printed on the back of the card |
| Expiry | MM/YY format, must be a future date |
Quick JavaScript Validation
function isValidVisa(number) {
const cleaned = number.replace(/\s|-/g, '');
// Must start with 4 and be 16 digits
if (!/^4\d{15}$/.test(cleaned)) return false;
// Luhn check
let sum = 0;
for (let i = cleaned.length - 1; i >= 0; i--) {
let digit = parseInt(cleaned[i]);
if ((cleaned.length - i) % 2 === 0) {
digit *= 2;
if (digit > 9) digit -= 9;
}
sum += digit;
}
return sum % 10 === 0;
}
// Test it
console.log(isValidVisa('4242 4242 4242 4242')); // true
console.log(isValidVisa('4111 1111 1111 1111')); // true
console.log(isValidVisa('5111 1111 1111 1111')); // false (not Visa)
console.log(isValidVisa('4111 1111 1111 1112')); // false (bad Luhn)
Quick Python Validation
import re
def is_valid_visa(number: str) -> bool:
cleaned = re.sub(r'[\s-]', '', number)
# Must start with 4 and be 16 digits
if not re.match(r'^4\d{15}$', cleaned):
return False
# Luhn check
digits = [int(d) for d in cleaned]
for i in range(len(digits) - 2, -1, -2):
digits[i] *= 2
if digits[i] > 9:
digits[i] -= 9
return sum(digits) % 10 == 0
# Test it
print(is_valid_visa('4242 4242 4242 4242')) # True
print(is_valid_visa('4111 1111 1111 1111')) # True
print(is_valid_visa('5111 1111 1111 1111')) # False
Common Visa BINs by Issuer and Country
For testing region-specific or issuer-specific scenarios, here are widely known Visa BIN ranges:
United States
| BIN Range | Issuer | Card Type |
|---|---|---|
| 4147 09 | JPMorgan Chase | Visa Signature |
| 4761 73 | Chase | Visa Infinite |
| 4217 83 | Capital One | Visa Platinum |
| 4319 40 | USAA | Visa |
| 4266 84 | Citibank | Visa |
| 4147 20 | Wells Fargo | Visa Signature |
United Kingdom
| BIN Range | Issuer | Card Type |
|---|---|---|
| 4213 45 | Santander UK | Visa Debit |
| 4659 01 | Barclays | Visa Debit |
| 4543 13 | Lloyds Bank | Visa Debit |
| 4462 74 | HSBC | Visa |
Europe
| BIN Range | Issuer | Country | Card Type |
|---|---|---|---|
| 4509 35 | N26 | Germany | Visa Debit |
| 4818 71 | ING | Netherlands | Visa |
| 4035 01 | Revolut | Lithuania | Visa |
| 4745 59 | BBVA | Spain | Visa |
Latin America
| BIN Range | Issuer | Country | Card Type |
|---|---|---|---|
| 4509 95 | Banco Galicia | Argentina | Visa |
| 4235 64 | Itaú | Brazil | Visa |
| 4517 63 | Bancolombia | Colombia | Visa |
| 4815 28 | BBVA Bancomer | Mexico | Visa |
Asia-Pacific
| BIN Range | Issuer | Country | Card Type |
|---|---|---|---|
| 4565 61 | DBS Bank | Singapore | Visa |
| 4297 18 | ICICI Bank | India | Visa |
| 4920 00 | ANZ | Australia | Visa |
| 4565 25 | Kasikornbank | Thailand | Visa |
Remember: These BIN ranges are for testing and educational purposes. Use the BIN Checker to verify any BIN's issuer, country, and card type.
Visa Subtypes: Classic, Gold, Platinum, Infinite, Electron
Not all Visa cards are the same. Different subtypes have different BIN ranges, acceptance rules, and interchange fees. When testing, it can matter.
| Subtype | Description | Typical BIN Indicator | CVV Digits |
|---|---|---|---|
| Visa Classic | Standard consumer card | Varies by issuer | 3 |
| Visa Gold | Mid-tier with travel perks | Varies by issuer | 3 |
| Visa Platinum | Premium tier, higher limits | Varies by issuer | 3 |
| Visa Signature | High-end, premium benefits | Varies by issuer | 3 |
| Visa Infinite | Top tier, concierge services | Varies by issuer | 3 |
| Visa Electron | Debit, always online-authorized | 4026, 4175, 4508, 4844, 4913, 4917 | 3 |
| Visa Corporate | Business/corporate accounts | Varies by issuer | 3 |
Testing tip: If your checkout handles Visa Electron differently (some merchants don't accept it), generate test cards with Electron BINs (4026, 4508, etc.) using Namso Gen to verify your logic handles the rejection or acceptance correctly.
Gateway Test Cards vs Generated Cards: When to Use Each
| Scenario | Use Gateway Test Cards | Use Namso Gen |
|---|---|---|
| Basic payment flow | ✅ | — |
| Specific decline/error codes | ✅ | — |
| 3D Secure testing | ✅ | — |
| Form field validation | — | ✅ |
| Bulk/load testing | — | ✅ |
| BIN-specific testing | — | ✅ |
| Region/country-specific cards | — | ✅ |
| Card type testing (Electron, Platinum) | — | ✅ |
| Unit tests (no gateway connection) | — | ✅ |
| Automated QA suites | ✅ + ✅ | Combine both |
The sweet spot: use gateway test cards for end-to-end payment flow testing, and use Namso Gen for everything else — form validation, bulk generation, BIN-specific scenarios, and any test that doesn't need a live gateway connection.
For a deeper comparison, see our Credit Card Generator for Testing guide.
Frequently Asked Questions
Are Visa test card numbers real credit card numbers?
No. Test card numbers — whether from gateways or generators like Namso Gen — are not linked to any real bank account. They follow the correct format and pass Luhn validation, but they cannot be used for actual purchases.
Why do all Visa cards start with 4?
The first digit is the Major Industry Identifier (MII). The digit 4 is assigned to banking and financial institutions, specifically Visa. Mastercard uses 5 (and some 2-series), Amex uses 3 (34 and 37). This is defined by the ISO/IEC 7812 standard.
Can I use Stripe test cards in PayPal's sandbox?
No. Each gateway has its own test card numbers that only work in that gateway's sandbox environment. Stripe's 4242 4242 4242 4242 won't work in PayPal's sandbox. Use the gateway-specific cards listed above, or generate your own with Namso Gen for non-gateway testing.
How many digits does a Visa card number have?
Modern Visa cards are 16 digits. Historically, some Visa cards had 13 digits, but those are no longer issued and are rarely encountered in the wild. Your validation code should check for 16 digits.
What's the difference between Visa and Visa Electron for testing?
Visa Electron cards always require online authorization — they can't be processed offline. Some merchants don't accept Visa Electron. If your checkout has specific logic for card subtypes, you should test with Electron BINs (4026, 4175, 4508, 4844, 4913, 4917) to verify correct handling.
Is it legal to use generated Visa test numbers?
Yes. Generating Luhn-valid test numbers for development and testing is completely legal. These numbers don't correspond to real accounts and can't be used for transactions. Payment testing with synthetic data is standard practice across the industry. For more on this, read our safety guide.
How do I test Visa 3D Secure (Verified by Visa)?
Use your gateway's specific 3D Secure test cards. For Stripe, use 4000 0025 0000 3155 (3DS1) or 4000 0000 0000 3220 (3DS2). Other gateways have their own 3DS test numbers — check the gateway tables above.
Can I generate Visa Electron test cards with Namso Gen?
Yes. Enter a Visa Electron BIN (like 402600, 450800, or 491700) in Namso Gen to generate test cards specifically for Visa Electron scenarios.