Mastercard Card Number Validator

Validate a Mastercard card number: prefix, length and Luhn checksum. Runs in your browser.

Try a test card:

Need test numbers? Use the test card generator →

🔒 The check runs entirely in your browser — the number is never sent or stored. Still, avoid typing real card numbers into any website; use test cards instead.

Mastercard card number format

Starts with (IIN)
51–55 or 2221–2720
Length
16 digits
Security code
3 digits
Check digit
Luhn (mod 10)
Test number
5555555555554444

A Mastercard number starts with 51–55 or 2221–2720 and has 16 digits. The last digit is a Luhn check digit, so a typo in one digit is almost always caught before the payment reaches the bank.

FAQ

How do I know if a Mastercard card number is valid?

Paste it above: the validator checks the prefix, the length and the Luhn checksum, and tells you which last digit is expected if the checksum fails.

Does a valid Mastercard number mean the card works?

No. Only the issuing bank can confirm the card exists and can be charged, during an authorization.

Where can I get Mastercard test numbers?

Use the Mastercard test card generator or the official sandbox cards of Stripe and Adyen, e.g. 5555555555554444.

Other card brands

Visa · American Express · Discover · JCB · Diners Club · UnionPay · Maestro