security · 2025-02-17 · 6 min read
CVV, CVC, CID: the code you must never store
The three- or four-digit code proves the card is physically present. It cannot be derived from the number, cannot be validated offline, and must never be saved — even encrypted.

Each network has its own name for the card security code — CVV2 (Visa), CVC2 (Mastercard), CID (American Express, four digits printed on the front), CAV2 (JCB), CVN2 (UnionPay). All serve the same purpose: evidence that whoever is paying can see the physical card, which is why it is never embossed and never stored on the magnetic stripe. Flip the card preview at the top of this page to see where each brand prints it.
How the code is generated
The issuer derives it from the PAN, the expiry date and a service code using a secret key pair (the CVK). Without those keys the value is unpredictable. The Wikipedia entry covers the cryptographic detail.
Why it cannot be validated locally
A front end can only check the length — three digits for most brands, four for Amex, as our prefix table shows. Anything that claims to 'verify' a CVV offline is guessing. Real verification happens when the issuer recomputes the code during authorization and returns a CVV match result.
Never store it
PCI DSS classifies the security code as sensitive authentication data: it must not be retained after authorization under any circumstances, even encrypted, even for recurring billing.
Practical consequences for developers:
- Keep it in memory only for the duration of the tokenization request; never write it to logs, analytics or session storage.
- For subscriptions, rely on a network token and the issuer's recurring-payment flags instead of re-using the code.
- Mask the field, disable autocomplete suggestions for it, and clear it on error.
The PCI Security Standards Council publishes the exact wording in Requirement 3.

Keywords: CVV, CVC, CID, card security code, CVV2, card verification value, PCI DSS CVV storage
Frequently asked questions
Is CVV the same as CVC?
Functionally yes. CVV2 is Visa's name, CVC2 is Mastercard's, CID is American Express's four-digit front-of-card code.
Can a website save my CVV for next time?
No. PCI DSS forbids storing the security code after a transaction is authorized.