ℹ️
Reference Content: This is a copy of content from the PCI Security Standards Council FAQ database, preserved for tracking changes over time.
View Original →
FAQ #1137 Published

How can I validate if a number is a legitimate credit card number?

The Luhn formula or Modulus 10 is the algorithm most often used to validate Primary Account Numbers (PAN). The algorithm works as follows:                        

  1. double the value of alternate digits of the PAN beginning with the second digit from the right (for any resulting value greater than 10, subtract 9),
  2. add the calculated values as well as the values skipped in step 1 together,
  3. the total obtained in step 2 must be divisible by 10.  Note that this formula tells you whether the payment card number is a possible and valid number, but not whether it's actually been issued and is active.

Disclaimer: This FAQ has been processed for display on this website and may contain errors. Please check the original FAQ on the PCI SSC website for the authoritative version.