Luhn Check Digit Validator and Calculator
The Luhn formula protects card numbers, IMEIs and many account numbers against typos. Enter one number per line: the tool checks the last digit or calculates it. Please use sample or test numbers only.
How it is calculated
Do not enter real card details. The calculation runs only in your browser; your input is not sent, not stored and not added to the address bar. The result is a pure format check: it says nothing about whether a card exists, is blocked or has funds.
How the Luhn algorithm works
- Starting from the right and skipping the check digit, double every second digit.
- If the doubled value is greater than 9, add its digits (same as subtracting 9): 7 × 2 = 14 → 5.
- Add up all digits. The check digit tops the sum up to the next multiple of 10.
Example 7992739871: from the right 1→2, 7, 8→16→7, 9, 3→6, 7, 2→4, 9, 9→18→9, 7. The sum is 67; 3 is missing to reach 70 → full number 79927398713. To validate, include the check digit: the sum must be divisible by 10 (here 70).
Where is Luhn used?
In card numbers under ISO/IEC 7812-1 (payment and many loyalty cards), in the 15th digit of a mobile phone’s IMEI (3GPP TS 23.003) and in many customer and contract numbers. It catches every single wrong digit and almost all swaps of adjacent digits – except “09” ↔ “90”. It does not protect against made-up numbers: one in ten random numbers passes.
For testing you can use the textbook example 79927398713 or the IMEI from the 3GPP standard, 49015420323751-8.
Frequently asked questions
Is my card number valid if it passes the Luhn check?
No. The check only shows that the digit sequence is well-formed. Whether a card exists, is active or has funds is known only to the issuing bank. Enter real card details only in a merchant’s checkout.
Is my input stored or transmitted?
No. The calculation runs in JavaScript on your device, the input is not in the URL and is not saved in your browser. Still, please use only sample or test numbers.
Can I check an IMEI with it?
Yes. The 15-digit IMEI ends with a Luhn check digit (3GPP TS 23.003, Annex B). Enter all 15 digits in “validate” mode, or the first 14 in “calculate” mode.
Which errors does the Luhn algorithm miss?
The swap of 0 and 9 (09 ↔ 90), twin errors such as 22 ↔ 55, 33 ↔ 66, 44 ↔ 77, and several simultaneous errors that happen to cancel out.
Why is there no card issuer detection?
The mapping of leading digits (IIN/BIN) to issuers changes constantly and is not needed for a format check. The tool deliberately limits itself to the check digit.
Sources and legal basis
- ISO/IEC 7812-1: ISO/IEC 7812-1:2017 – Identification cards, Annex: Luhn formula for computing modulus-10 check digits
- 3GPP TS 23.003: 3GPP TS 23.003 – Numbering, addressing and identification, Annex B: IMEI check digit (Luhn)
- US Patent 2,950,048 – H. P. Luhn, Computer for verifying numbers (1960)
As of:
Related tools
- EAN, GTIN and ISBN ValidatorValidate EAN-8, EAN-13, UPC-A, GTIN-14 and ISBN-10/13 check digits, calculate a missing check digit and convert ISBN-10 to ISBN-13 – free, in your browser.
- IBAN CheckerValidate any IBAN: mod-97 check digits, length and structure for 89 countries, plus bank and BIC for German IBANs. Runs in your browser – nothing is sent.
- Validate Email Address SyntaxCheck one or many email addresses for correct syntax under RFC 5321/5322: lengths, domain labels, international domains (Punycode). Local, nothing sent.
- Aspect Ratio CalculatorCalculate the aspect ratio from width and height (1920 × 1080 = 16:9), find the missing side, decimal value, nearest standard ratio and CSS aspect-ratio.
- Base64 Encode and DecodeEncode and decode Base64 and Base64url with proper UTF-8, plus URL encode/decode (percent-encoding). Clear error messages, runs locally in your browser.
- CSS border radius generatorRound corners with sliders: all corners linked or each on its own, px or %, elliptical 8-value syntax – shortest CSS shorthand, live preview and copy button.