CVV / CVC calculator
Card verification values (CVV1/CVV2/iCVV) with step-by-step trace.
- Runs in your browser
- No sign-up
Input
CVV 465
Result
- KCV CVKA
- D5D44F
- KCV CVKB
- A68CDC
Computation trace
Test keys only. Production CVKs belong in an HSM.
Setting up CVV keys and service codes for a new card program? IDNTEQ can help. Card-program implementation in Brazil
About this tool
Runs in your browser. This page loads no analytics or third-party scripts and does not send what you type.
Compute the magnetic-stripe card verification value (CVV/CVC) from a CVK pair, PAN, expiry and service code, with the full block-assembly and encryption trace. Presets set the service-code convention for CVV1, CVV2 and iCVV.
How the value is derived
The PAN, expiry (YYMM) and service code are concatenated and zero-padded to two 8-byte blocks. Block 1 is DES-encrypted under CVKA, XORed with block 2, then processed with the standard TDES encrypt-decrypt-encrypt using CVKA/CVKB. The result is decimalised (digits first, then A–F mapped to 0–5) and the leading three digits are the CVV.
CVV1 uses the service code encoded on the track (201 in the preset). By convention CVV2 is computed with service code 000 and iCVV with 999. The presets set these values. Missing or non-numeric fields are rejected rather than padded.
Spec references
- Visa CVV algorithm
- Mastercard CVC1/CVC2
- ISO/IEC 7813 (track data)
Verified against
- Specifications
- Visa CVV / Mastercard CVC method (DES and TDES with CVKA, CVKB, decimalisation)
- ISO/IEC 7813 (service code)
- Published examples in the tests
- Other checks in the tests
- CVV1, CVV2 (000) and iCVV (999) against an OpenSSL TDES construction of the method
- Missing, over-long or non-numeric fields are errors
- Inputs
- CVK pair (16 bytes) or one 8-byte key, PAN 8–19 digits, expiry as 4 digits, service code as 3 digits.
- Not covered
- Dynamic CVV / CVC3 and Amex CSC are not computed. Whether the expiry is YYMM or MMYY depends on the issuer.
- Last reviewed