Credit Card Validator

Luhn checksum plus card-brand detection — all in your browser.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

A credit card validator that runs the two checks every payment form relies on for instant client-side feedback: the Luhn (mod-10) checksum and card-brand detection from the number’s leading digits. Paste a number and you immediately see whether it is internally well-formed, which network it belongs to, and whether its length is correct for that brand. Everything happens in your browser — no number is ever uploaded, and no bank or payment API is contacted.

How it works

A card number is not random. The first six to eight digits are the Issuer Identification Number (IIN, historically called the BIN), and each network owns specific ranges: Visa numbers begin with 4, Mastercard with 51-55 or 2221-2720, American Express with 34 or 37, Discover with 6011/65, and so on. This tool matches the most specific prefix to name the brand and look up its allowed lengths and CVV size.

The final digit is a Luhn check digit. Reading right to left, every second digit is doubled (subtracting 9 from any result above 9), all digits are summed, and the number is valid only when that sum is divisible by 10. This catches virtually every single-digit typo and most adjacent transpositions — which is exactly why checkout pages reject a mistyped number before you ever press pay.

A number is reported as valid only when both checks pass: the Luhn checksum is satisfied and the length matches the detected brand. The brand table below is searchable so you can compare IIN ranges across networks at a glance.

Example

Take 4539 1488 0343 6467. The leading 4 identifies it as Visa, the length is 16 digits (allowed for Visa), and the Luhn sum lands on a multiple of 10 — so it is reported as a valid Visa number. Change a single digit, say to 4539 1488 0343 6468, and the Luhn checksum fails: the verdict flips to invalid even though the brand and length are still fine.

NumberBrandLengthLuhnVerdict
4242 4242 4242 4242Visa16passValid
5555 5555 5555 4444Mastercard16passValid
3782 822463 10005Amex15passValid
4242 4242 4242 4241Visa16failInvalid

Every figure is computed locally — your input never leaves the device.

Ad placeholder (rectangle)