Advertisement

Prefix 4 · 13, 16, 19 digits · 3-digit CVV

Visa Credit Card Generator

Generate Visa test numbers that start with 4, have 16 digits (the standard length) and pass the Luhn check — with a random expiry date, 3-digit CVV and, optionally, a US billing address with ZIP code.

Advertisement

Runs in your browser · 8 networks · 374,788 BINs

Generated cards

Test data only — these numbers are not issued by any bank and every real payment with them will be declined. Need a card that works online? Ask your bank for a virtual card. Testing a checkout? Use your gateway’s sandbox test cards.

Advertisement

Prefix 4 · 13, 16, 19 digits · 3-digit CVV

Generated locally with your browser’s crypto API — nothing is sent to a server.

Visa format

Starts with
4
Length
13, 16, 19
Security code
3
Stripe
4242 4242 4242 4242
Advertisement

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 length16 (also 13 and 19) digits
Typical layout4xxx xxxx xxxx xxxx
Security code3-digit CVV2 on the back
Check digitLast digit, calculated with the Luhn (mod 10) algorithm
NetworkVisa Inc.
Example (test number)4242 4242 4242 4242
Advertisement

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.

GatewayTest number
Stripe4242 4242 4242 4242
Stripe (debit)4000 0566 5566 5556
Braintree / Authorize.net4111 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

  1. Generate a batch above and paste a 16-digit number, then a 19-digit one (type 4 followed 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.
  2. 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.
  3. Switch your payment provider to sandbox / test mode and use its documented test cards for authorization, decline and 3-D Secure scenarios.
  4. Never use real customer card numbers in development or staging environments.
Generated Visa numbers are for testing only. They are not linked to any Visa account, hold no balance and will be declined by any live payment system.

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.

Related tools

Brand ranges at a glance

The prefixes and lengths your checkout must accept. Each brand has its own generator page.

For developers & QA

Test data that stays out of PCI scope

Use generated numbers for everything before the payment request, then switch to your gateway’s official sandbox cards for approvals, declines and 3-D Secure.

  • Test form validation & input masks
  • Seed staging databases and demos
  • Reproduce declines and 3-D Secure in the sandbox
Browse gateway test cards

Official sandbox cards, per gateway

All 18 gateways →

Advertisement