Skip to main content
NyankoTools

Luhn Checker & Card Brand Detector

Verify the check digit of a card number (or any Luhn-protected ID) with the Luhn mod 10 algorithm and detect the brand from the leading digits (IIN/BIN). Fill in the public test numbers that payment providers publish for development and QA with one click. For other checksums, try the Checksum Calculator.

🔒 Runs in your browser · Your data is never sent to a server

Do not enter real credit card numbers. Use the test numbers below instead. Everything is processed in your browser only, and nothing is sent or stored.

2 to 19 digits. Spaces, hyphens and full-width digits are removed automatically. The last digit is the check digit.

Public test numbers

These are test numbers published in payment providers’ documentation. They are not real cards.

Result

Notes

  • Entering real credit or debit card numbers is not recommended. Calculation happens only in your browser and nothing is sent, stored or logged, but please use the test numbers anyway.
  • Passing the Luhn check does not mean the card exists, can be used, or belongs to the person entering it. The algorithm only exists to catch typing mistakes.
  • Brand detection is a simple lookup on the leading digits. The payment provider’s own determination is authoritative, and some domestic-only cards or newly issued ranges may not be recognized.
  • The test numbers listed here are the ones payment providers publish. They do not work in production, and which numbers are accepted can differ by provider.

Glossary

Luhn algorithm

Starting from the digit left of the check digit, double every second digit going leftwards, add all the digits together with the check digit, and the total must be a multiple of 10. It catches most single-digit errors and swaps of neighboring digits.

IIN / BIN

The Issuer Identification Number, the first 6 to 8 digits of a card number, identifies the card brand and issuer. It was formerly called the Bank Identification Number (BIN).

FAQ

Is it safe to enter a real credit card number?

The calculation runs only in your browser and nothing is sent or stored. Even so, entering real card numbers is not recommended; use the test numbers on this page instead.

If a number passes the Luhn check, can the card be used?

No. The Luhn check only catches typing mistakes. It cannot tell whether the card exists, has expired or can be charged, and about one random number in ten passes by chance.

How is the card brand detected?

By the leading digits (IIN/BIN). For example Visa starts with 4, Mastercard with 51-55 or 2221-2720, and JCB with 3528-3589. It is a simple lookup, so rely on your payment provider for the final answer.

How is the Luhn check digit calculated?

Double every second digit from the right (excluding the check digit), subtract 9 from any result above 9, and add everything up. The check digit is the number that brings the total to a multiple of 10. When a number fails, the expected check digit is shown.

Share this page

↑↓ Select Enter Open Esc Close