belun.app

Credit Card Validator — Luhn Check and Card Brand Detection

Try a published test number

These are sandbox numbers published by payment processors. No real account is behind them.

Paste a card number to see whether it is structurally valid: the Luhn checksum, the digit count, and the issuing network detected from the IIN prefix. Useful for testing payment forms, debugging a checkout flow, or catching a typo before a transaction fails. Everything runs in your browser — the number never leaves the page.

What the Luhn check digit catches and misses

Luhn filed a patent for the method at IBM in 1954. It expired long ago, and the same check digit now guards IMEI numbers on phones, Canadian Social Insurance Numbers and US National Provider Identifiers. For 4111 1111 1111 1111, the doubled digits sum to 8 + 7 × 2 = 22, the remaining ones to 8, and the total of 30 divides by 10.

Every single-digit error is caught. So is every swap of two neighbouring digits, with one exception: 09 and 90 produce the same sum. There is no key or secret involved, so a checkout form can reject a mistyped number before it ever reaches a payment network.

What the first digits of a card number encode

Card numbering follows ISO/IEC 7812, where the very first digit names the industry. The issuer identification number (IIN) used to be six digits long. The standard stretched it to eight in 2017, and Visa and Mastercard moved their networks over in April 2022, breaking BIN lookup tables hardcoded to six. The six digits shown above are still enough to pick the network.

First digit Industry Networks
3 Travel and entertainment American Express, Diners Club, JCB
4 Banking and financial Visa
5 Banking and financial Mastercard

Frequently asked questions

What is the Luhn algorithm?
A checksum published by IBM engineer Hans Peter Luhn in 1954. Starting from the right, every second digit is doubled (subtracting 9 from any result over 9), all digits are summed, and a valid number gives a total divisible by 10. It catches every single-digit error and almost every transposition.
Does passing this check mean the card works?
No. The Luhn checksum only proves the digits are internally consistent: it catches typos and swapped digits. Whether an account exists, has funds or is expired can only be answered by the issuing bank through a payment processor.
Which card networks are detected?
Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, Maestro, and Mir. Detection uses published IIN ranges, so a valid number from a network outside that list shows as unrecognised.
Why does my valid card show the wrong brand?
IIN ranges get reassigned, and some co-branded or regional cards use prefixes outside the ranges their network publishes. The Luhn and length results stay accurate even when brand detection guesses wrong.

Related tools