Skip to main content

Luhn / Test Card Validator

Check a number with the Luhn algorithm, find the card brand, and get public test card numbers for Stripe and Razorpay. Test numbers only.

Never paste a real card number. Nothing you enter is stored or sent, but a test number is all you need here.

Numbers

Stays in your browser

Official public test card numbers

Official public test card numbers

BrandGatewayNumberNote
VisaStripe4242424242424242 Succeeds
Visa (debit)Stripe4000056655665556 Succeeds
MastercardStripe5555555555554444 Succeeds
Mastercard (2-series)Stripe2223003122003222 Succeeds
American ExpressStripe378282246310005 Succeeds
DiscoverStripe6011111111111117 Succeeds
Diners ClubStripe3056930009020004 Succeeds
JCBStripe3566002020360505 Succeeds
UnionPayStripe6200000000000005 Succeeds
VisaRazorpay4386289407660153 Domestic test card
MastercardRazorpay5267318187975449 Domestic test card
VisaCommon4111111111111111 Widely used test number

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Free Online Luhn / Test Card Validator

Check whether a number passes the Luhn rule and which card brand it belongs to. Use the list of public test numbers when you build or test a payment form. It gives developers a quick browser-based way to solve a focused luhn / test card validator task before moving the result into a project.

How to use Luhn / Test Card Validator

Enter one number per line. Spaces and dashes are ignored.

Common mistakes

  • Pasting a real card number: use a test number instead.
  • Reading "valid" as "this card works": it only passed the Luhn check.

Frequently asked questions

What is the Luhn algorithm?
A simple check-digit rule used by card numbers, IMEI numbers and some ID numbers. It catches most single-digit mistakes and swapped neighbours. It does not say the number is a real account.
Can this tell me if a card is real?
No. Only the card issuer can. This tool only checks the shape of the number.
Are the test numbers safe to use?
They are published by the payment gateways for testing in their test modes. They do not work for real payments. Always check the gateway documentation for the latest list.
Is the number stored?
No. It is not saved, logged or sent. Even so, please use test numbers only.
How do I use this luhn / test card validator tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More DevOps & Network

View all DevOps & Network tools →