Credit Card Validator

Check if a credit card number is valid using the Luhn algorithm.

What is the Luhn Algorithm?

The Luhn algorithm (also known as the "modulus 10" or "mod 10" algorithm) is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, and more. Its purpose is to provide a quick check against accidental errors, like typos, during data entry.

How it Works:

  1. Double Every Second Digit: Starting from the second-to-last digit and moving left, double the value of every second digit.
  2. Sum the Digits: If doubling a digit results in a two-digit number, add those two digits together to get a single-digit number (e.g., 14 becomes 1 + 4 = 5).
  3. Add All Digits: Sum all the digits of the new number sequence (including the digits you didn't double).
  4. Check for Modulo 10: If the total sum is perfectly divisible by 10 (i.e., the total modulo 10 is 0), the number is considered valid according to the Luhn algorithm.

Important: This tool only checks if a number conforms to the Luhn algorithm. It does not verify if the card is active, has funds, or is a real, issued credit card. It is for validation and testing purposes only.