In Stripe test mode, the CVV field accepts any 3 digits, or 4 digits for American Express. Stripe does not send the value to an issuer. A payment with 4242 4242 4242 4242, any future expiry date, and any CVC returns a success. To force a failed security code check, use a card number that Stripe maps to that result, such as 4000 0000 0000 0127.
stripe test card cvv validation
What the CVV field does in test mode
Test mode runs on separate API keys. Publishable keys start with pk_test_ and secret keys start with sk_test_. No funds move and no issuer is contacted.
The card number controls the outcome. The CVC digits you type are ignored unless the card number is one that simulates a specific decline. Field length still follows the brand: 3 digits for Visa, Mastercard, and Discover, 4 digits for Amex.
Test card numbers and matching CVV values
- 4242 4242 4242 4242, Visa, any 3-digit CVC
- 4000 0566 5566 5556, Visa debit, any 3-digit CVC
- 5555 5555 5555 4444, Mastercard, any 3-digit CVC
- 2223 0031 2200 3222, Mastercard, any 3-digit CVC
- 3782 822463 10005, American Express, any 4-digit CVC
- 6011 1111 1111 1117, Discover, any 3-digit CVC
Use any expiry date in the future, any postal code, and any CVC length that matches the brand.
Test cards that fail the CVC check
Stripe keeps a set of card numbers that trigger decline codes. These are the ones tied to the security code:
- 4000 0000 0000 0127, incorrect CVC
- 4000 0000 0000 0101, CVC check fails
Other decline numbers are useful for a test suite:
- 4000 0000 0000 0002, generic decline
- 4000 0000 0000 9995, insufficient funds
- 4000 0000 0000 0069, expired card
- 4000 0000 0000 0119, processing error
- 4000 0027 6000 3184, requires 3D Secure authentication
Where the CVV goes in the request
Stripe.js and Stripe Elements collect the CVC inside an iframe served from Stripe's domain. The browser sends the value to Stripe. Your server receives a token or a PaymentMethod ID, not the digits.
The CVC stays out of your logs and your database. PCI DSS forbids storing the CVV after authorization, in test mode or live mode.
Limits of test mode
Test mode does not contact a card network. A CVC result in test mode comes from a lookup table on Stripe's side, not from an issuer response. Address verification results are simulated the same way.
Real card numbers are rejected in test mode. Test objects live in a separate environment from live objects, so a test PaymentMethod cannot be charged with a live key.
Common errors
A message reading "Your card's security code is incorrect" in test mode means the card number is a decline test card. Change the number to 4242 4242 4242 4242 to get a success.
A decline on a test card with a live key means the environments are mixed. Check the key prefix before you debug the form.
Do not enter real card data on a page you do not control. Test numbers are public and safe to use; live numbers are not.