Luhn Algorithm Checker
Validate credit card numbers, IMEI codes, and other identifiers using the Luhn (mod 10) algorithm. Identifies card type and checks digit validity.
0 digits entered
Load test card
How to Use Luhn Algorithm Checker
- 1Enter a credit card number or IMEI code.
- 2See if the number passes the Luhn algorithm checksum.
- 3View the detected card type (Visa, Mastercard, Amex, etc.).
- 4Use for testing payment forms with valid test card numbers.
Zenovay
Privacy-first analytics for your website
Understand your visitors without invasive tracking. GDPR compliant, lightweight, and powerful.
Related Tools
JSON Formatter & ValidatorFormat, validate, and beautify JSON data with syntax highlighting and error detection.
JWT DecoderDecode and inspect JWT tokens. View header, payload, and verify signatures.
Base64 Encode/DecodeEncode text to Base64 or decode Base64 back to text. Supports UTF-8 and binary data.
URL Encode/DecodeEncode or decode URL components. Handle special characters, query strings, and full URLs.
Frequently Asked Questions
What is the Luhn algorithm?▾
The Luhn algorithm (also known as the mod 10 algorithm) is a simple checksum formula used to validate identification numbers. Created by IBM scientist Hans Peter Luhn in 1954, it works by: (1) From the rightmost digit, double every second digit. (2) If doubling produces a number > 9, subtract 9. (3) Sum all digits. (4) If the total is divisible by 10, the number is valid. It is designed to catch accidental single-digit errors and transpositions of adjacent digits.
Which numbers use the Luhn algorithm?▾
Credit and debit card numbers (all major networks: Visa, Mastercard, Amex, Discover, JCB, UnionPay), IMEI numbers (15-digit mobile device identifiers), Canadian Social Insurance Numbers (SIN), some national ID numbers, ICCID (SIM card identifiers), and NPI (National Provider Identifier) numbers in US healthcare. The algorithm is a basic sanity check — it does not guarantee a card is active or funds are available.
What are test credit card numbers?▾
Payment processors provide test card numbers for development. Stripe test cards: 4242 4242 4242 4242 (Visa), 5555 5555 5555 4444 (Mastercard), 3782 822463 10005 (Amex). PayPal sandbox uses the same Luhn-valid numbers. These numbers pass the Luhn check and are recognized as test cards by payment gateways — they cannot be used for real transactions. Never use real card numbers in development or testing.
What card types does this tool detect?▾
Card type is determined by the card number prefix (IIN/BIN): Visa (starts with 4, 13 or 16 digits), Mastercard (starts with 51-55 or 2221-2720, 16 digits), American Express (starts with 34 or 37, 15 digits), Discover (starts with 6011, 622126-622925, 644-649, or 65, 16 digits), JCB (starts with 3528-3589, 16 digits), Diners Club (starts with 300-305, 36, or 38, 14 digits).
Does a Luhn-valid number mean the card is real?▾
No. The Luhn algorithm only verifies the mathematical checksum of the number sequence. A number can pass Luhn validation but still be: non-existent (the bank has never issued that number), expired, cancelled, or declined. Actual card authorization requires a real-time check with the card network and issuing bank, including CVV/CVC verification, expiry date, billing address, and available balance. Luhn is purely a format check to catch typos.