Paste a card number and see whether its check digit adds up, digit by digit. The more useful half of this page is what a pass still does not prove.
Only one thing: the digits are internally consistent. Luhn is a checksum designed in the 1950s to catch the two mistakes humans make when copying numbers — a mistyped digit, and two adjacent digits swapped. That is the whole job.
A Luhn pass does not tell you that the card exists, that it was ever issued, that it is active, that it has funds, or that the person holding it owns it. 4111111111111111 passes and has never belonged to anyone. Any string of digits can be made to pass by choosing the last one.
Walk the number from right to left. Leave the rightmost digit alone; double every second digit after that. If doubling gives more than 9, subtract 9 (so 8 becomes 16 becomes 7). Add everything up. If the total divides evenly by 10, the number passes.
The rightmost digit is the check digit — it is not part of the account number, it exists only to make the total come out right. That is why the tool above shows you the digit that would make it pass: if a number fails by one digit, that is usually where the typo is.
The number Luhn checks is the PAN, which travels in DE2 (and inside the track 2 data in DE35). Most acquirers run a Luhn check before building the message at all, which is why a mistyped card number usually produces a form error rather than a response code.
When it does reach the issuer, the failure you get back is a normal decline, not a format error — typically DE39 = 14, invalid card number. Note the asymmetry: a Luhn-valid number can still come back as 14, because 14 means no such account, not bad checksum.