About Visa card numbers
Visa is the most widely accepted card network outside China. It started in 1958 as BankAmericard, issued by Bank of America in California, and took the Visa name in 1976. Visa does not issue cards itself: banks and fintechs issue Visa credit, debit and prepaid cards, and Visa runs the network that routes authorizations between the merchant and the issuer.
Every Visa number begins with the digit 4. The first six to eight digits form the BIN (bank identification number), which tells a payment system which bank issued the card and whether it is credit, debit or prepaid. Modern Visa cards have 16 digits; a few legacy cards have 13 digits and some newer debit products use 19.
Because Visa is accepted almost everywhere, it is the brand most checkout forms are tested with first. Use the generator above to check that your form accepts 16-digit numbers starting with 4, formats them in groups of four, shows the Visa logo and rejects numbers whose check digit is wrong.
Visa card number format and example
| Starts with (IIN) | 4 |
|---|---|
| Number length | 16 (also 13 and 19) digits |
| Typical layout | 4xxx xxxx xxxx xxxx |
| Security code | 3-digit CVV2 on the back |
| Check digit | Last digit, calculated with the Luhn (mod 10) algorithm |
| Network | Visa Inc. |
| Example (test number) | 4242 4242 4242 4242 |
Official Visa sandbox test numbers
Payment gateways publish fixed test numbers that only work in their test mode. Use them when you need a predictable gateway response; use the generator above for bulk or randomized data.
| Gateway | Test number | |
|---|---|---|
| Stripe | 4242 4242 4242 4242 | |
| Stripe (debit) | 4000 0566 5566 5556 | |
| Braintree / Authorize.net | 4111 1111 1111 1111 |
Sources: the gateways' own documentation — Stripe, PayPal, Braintree, Adyen.
Visa test cards with a billing ZIP code
Most US checkouts ask for a billing address, and the gateway runs an address check (AVS): it compares the house number and the ZIP code with what the issuing bank has on file. To fill those fields, tick Add billing address & ZIP (US) above. Every generated Visa number then comes with a street address, city, state and a real ZIP code that belongs to that city, and the address is included in the CSV, JSON, XML and pipe exports.
A sandbox does not compare the address with a bank, so any well-formed ZIP code passes. To get a specific AVS response, use the values your gateway documents, for example the Authorize.net ZIP codes or the Braintree postal codes. For ZIP codes on their own, use the ZIP code generator.
How to test Visa payments safely
- Generate a batch above and paste a 16-digit number, then a 19-digit one (type
4followed by 18 x’s in the BIN field): your form should accept both, group the digits as the customer types and show the Visa logo. - Change one digit of a generated number — your form should now reject it, because the Luhn check fails. You can confirm why with the validator.
- Switch your payment provider to sandbox / test mode and use its documented test cards for authorization, decline and 3-D Secure scenarios.
- Never use real customer card numbers in development or staging environments.
Frequently asked questions
How many digits does a Visa card number have?
Usually 16. Visa also allows 13 and 19 digits, so a robust form should accept all three lengths for numbers starting with 4.
What is the Visa test card number for Stripe?
Stripe documents 4242 4242 4242 4242 with any future expiry date and any 3-digit CVC. It only works in Stripe test mode.
Where is the CVV on a Visa card?
The 3-digit CVV2 is printed on the back of the card, next to the signature panel. It is never part of the card number and is not stored on the magnetic stripe.
What does a Visa card number look like?
16 digits starting with 4, grouped 4-4-4-4 — for example the test number 4111 1111 1111 1111. The 3-digit CVV2 is on the back.
Can I buy something or start a free trial with a generated card?
No. A real payment needs an authorization from the issuing bank, and no bank has issued these numbers, so every charge is declined. Trying to pay with a number you do not own is fraud. Use them only in sandboxes, forms and test data.