Credit Card Number Validator

Check whether a card number has a valid format: the Luhn checksum, the brand from its first digits, and an allowed length. Useful for testing payment forms. It can't tell whether a card is real or has funds.

Updated
Checked in your browser. The number is never sent, stored, or logged.
This checks the number's format only.

It can't tell whether a card exists, is active, or has funds. Don't enter someone else's card.

Brand
–
Luhn check
–
Length
–
Formatted
–

How to use the Credit Card Validator

  1. Type or paste the number into Card number. Spaces and dashes are fine.
  2. Read the result: Brand, Luhn check, Length, and the Formatted number.
  3. For numbers to test with, press Get test card numbers.

How it works

The Luhn algorithm (mod 10) catches typos:

  1. Starting from the rightmost digit, double every second digit.
  2. If doubling gives more than 9, subtract 9.
  3. Add all digits. The number is valid when the total is a multiple of 10.

The brand comes from the first digits (the IIN): 4 is Visa, 51-55 and 2221-2720 are Mastercard, 34 and 37 are American Express, 6011, 644-649, and 65 are Discover, 3528-3589 are JCB, and 62 is UnionPay. Each brand also has allowed lengths, such as 15 digits for Amex.

Examples

  • 4111 1111 1111 1111: valid, Visa, 16 digits.
  • 4111 1111 1111 1112: invalid, the Luhn check fails.
  • 3782 822463 10005: valid, American Express, 15 digits, grouped 4-6-5.
  • 2223 0031 2200 3222: valid, Mastercard from the 2-series range.

Limitations

  • A valid format doesn't mean the card exists, is active, or belongs to anyone. Only the card network can confirm that, during a payment.
  • IIN ranges change over time; rare and new ranges may show as Unknown while still being valid.
  • Don't enter real card numbers you don't own. This tool is meant for testing forms and fixing typos.

Frequently asked questions

Is it safe to enter a card number here?

The check runs in your browser and the number is never sent, stored, or logged. Still, only enter test numbers or your own card.

What is the Luhn check?

A checksum that every major card number passes. It catches a single wrong digit and most swaps of two neighbouring digits.

Can this tell me if a card is real?

No. It checks the format only. Whether a card exists or has funds can only be checked by the bank during a payment.

Why does my Mastercard start with 2?

Mastercard added the 2221-2720 range in 2017. Older validators reject these numbers; this one accepts them.

Often used together with the Credit Card Validator.