Credit Card Number Validator

Check that a card number is correctly formed: its Luhn check digit, its length and the card network its first digits belong to. The check runs in your browser and the number isn't sent anywhere.

Built for testing payment forms and catching typos. It can't tell whether a card exists, is active or can be charged.

Try a test number:

Spaces and dashes are ignored. Results update as you type.

Privacy: the check is JavaScript running on this page. The number isn't sent to Orbit2x or anyone else, and isn't saved. Even so, use test numbers rather than a real card where you can.

Test Card Numbers

These numbers come from Stripe's testing documentation. They pass the Luhn check but aren't linked to any account. Other payment providers publish their own lists, and in test mode each provider only accepts the numbers it documents.

Test card numbers by network
NetworkNumberAction
Visa - Standard test card4242 4242 4242 4242
Visa - Debit card4000 0566 5566 5556
Mastercard - Standard test card5555 5555 5555 4444
Mastercard - Debit card5200 8282 8282 8210
American Express3782 822463 10005
American Express - Alternative3714 496353 98431
Discover6011 1111 1111 1117
Discover - Alternative6011 0009 9013 9424
Diners Club3056 9300 0902 0004
JCB3566 0020 2036 0505

What the Validator Checks

  • Network: the first digits show which card network issued the number, such as 4 for Visa or 34 and 37 for American Express.
  • Length: card numbers have 12 to 19 digits, and each network uses particular lengths. American Express numbers, for example, always have 15.
  • Check digit: the last digit is calculated from the others with the Luhn formula. A wrong digit, or two neighbouring digits swapped, almost always breaks it.

It doesn't check whether the card exists, who holds it, its expiry date or security code, or whether it can be charged.

How the Luhn Check Works

  1. Starting from the rightmost digit (the check digit), double every second digit moving left.
  2. If doubling gives a two-digit number, subtract 9 (the same as adding its two digits).
  3. Add up all the digits. The number passes if the total ends in 0.

Worked example with 79927398713:

Luhn calculation for 79927398713
Digit79927398713
Doubled?×2×2×2×2×2
Value79947697723

7 + 9 + 9 + 4 + 7 + 6 + 9 + 7 + 7 + 2 + 3 = 70, which ends in 0, so the number passes. Changing the last digit to 4 gives 71, which fails. The doubled 9 became 18, then 18 − 9 = 9; the doubled 8 became 16, then 7.

Card Number Prefixes and Lengths

These are the ranges the validator recognises. When two ranges overlap, the longer, more specific prefix wins.

Starting digits and lengths for each card network
NetworkStarts withDigits
Visa413, 16, 19
Mastercard51-55 or 2221-272016
American Express34 or 3715
Discover6011, 622126-622925, 644-649, 6516, 19
Diners Club300-305, 36, 3814, 16, 19
JCB3528-358916, 19
UnionPay6216 to 19
Maestro5018, 5020, 5038, 5893, 6304, 6759, 6761-676312 to 19

Networks change their ranges from time to time; Mastercard added the 2221 to 2720 range in 2017. A number from a newer or regional network may show as not recognised and still be a real card.

How the Check Is Made

The check is JavaScript that runs in your browser. The number you type isn't sent to Orbit2x or any other service and isn't saved, and the input isn't part of a form that can be submitted. See the privacy policy for the site's general data practices.

Frequently Asked Questions

Does a valid result mean the card is real?

No. A correctly formed number has the right length and a matching check digit, which anyone can produce. Only the card issuer, through a payment provider, can say whether a card exists, is active and has funds.

Can it tell me which bank issued the card?

No. The first six to eight digits (the BIN or IIN) identify the issuing bank, but matching them needs a BIN database, which this tool doesn't use. It only identifies the network from the published prefix ranges.

Why is a number starting with 622 shown as Discover?

Numbers from 622126 to 622925 are UnionPay cards that are also accepted on the Discover network, so the checker labels that range Discover. Other numbers starting with 62 are shown as UnionPay.

Is it safe to type a real card number here?

The number isn't sent anywhere: the check runs in JavaScript on this page, which you can confirm in your browser's network tab. As a habit, though, avoid typing real card numbers into sites that don't need them, and use test numbers when you're testing.

Should my checkout form use the Luhn check?

Yes, as a quick check that catches typos before the form is submitted. It doesn't replace the payment provider's checks, and anyone can bypass checks that run in the browser. If you handle card numbers yourself, the PCI DSS rules apply; most sites avoid that by using the provider's hosted fields.