Luhn algorithm checker: validate and calculate check digits
The Luhn algorithm 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.
Source: ISO/IEC 7812-1, ISO/IEC 7812-1:2017 – Identification cards, Annex: Luhn formula for computing modulus-10 check digits. Updated: .
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.
More check digit tools: the EAN check digit calculator, the IBAN checker and the EU VAT number checker.
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: · Editorial policy
Related tools
- EAN and ISBN check digit calculator and validator (GTIN)Validate 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.
- What is my IP address?What is my IP? See your public IPv4 or IPv6 address at once, plus approximate location, internet provider and browser details. Free, never stored.
- ASCII table with decimal, hex, octal, binary and Unicode lookupASCII table 0–127 plus Latin-1 and Windows-1252: decimal, hex, octal, binary, HTML entity, control codes. Search it, click to copy, convert text to codes.
- EU VAT Number Checker (Format and Check Digit)Check the format and check digit of an EU VAT number for all 27 member states and Northern Ireland (XI). Runs locally, with links to VIES for validation.
- IEEE 754 converterIEEE 754 converter for half, single and double: convert decimal, hex or bits, and see sign, exponent, mantissa and the exact stored value with rounding error.
- Px to Rem ConverterPx to rem converter with your own base font size, plus em, pt, percent and vw, and a lookup table of common font sizes. Free, no sign-up, works offline.
- JavaScript minifierJavaScript minifier: remove comments and whitespace, shrink the code and see the saving in bytes. In your browser, no upload.