Runs entirely in your browser · nothing stored

Generate Luhn-Valid Test Card Numbers for Payment-Form QA

A credit card generator that passes validation, not payments.

Luhnly generates fake, Luhn-valid test credit card numbers for Visa, Mastercard, Amex and Discover — built for developers and QA engineers testing checkout flows. Free, instant, no signup.

VISA
✓ Luhn valid
specimen
4539 1122 8890 1234
Cardholder A. TESTER
Expires 08/29
CVV 123
Luhn check: valid Real transactions: not possible

How the Luhn Checksum Actually Works

Every real card number ends in a check digit chosen so the whole number passes a specific arithmetic test. Luhnly generates numbers the same way a card issuer would, minus the part where a bank actually opens an account behind it.

Pick a network prefix

Each brand owns a reserved range: Visa numbers start with 4, Mastercard with 51–55 or 2221–2720, Amex with 34 or 37, Discover with 6011 or 65.

Fill the middle digits randomly

The digits between the prefix and the final check digit are generated at random, giving each card a unique, non-sequential number.

Double every second digit from the right

Starting from the rightmost digit and moving left, every second digit is doubled. If doubling produces a number over 9, its digits are added together (e.g. 8 → 16 → 1+6 → 7).

Sum everything and solve for the check digit

All digits are added up. The check digit is whatever value makes that total divisible by 10 — that final digit is what makes the number "Luhn-valid."

Supported Card Networks

Luhnly builds each number from the correct issuer prefix (IIN/BIN range) so it matches the length and format your form should expect from a real card of that type.

NetworkPrefix rangeLengthCVV length
Visa416 digits3
Mastercard51–55, 2221–272016 digits3
American Express34, 3715 digits4
Discover6011, 644–649, 6516 digits3

Who Actually Uses This

Developers

Testing checkout UI, input masks, and card-type detection without a live payment gateway.

QA engineers

Writing automated test cases that need realistic but harmless card data at scale.

Students

Learning how checksum validation and card-number structure work, hands-on.

Not for: real purchases, subscriptions, or any transaction. These numbers aren't linked to any real account, so they can't successfully authorize a real charge — that's by design, not a bug.

Frequently Asked Questions

Are these real credit card numbers?

No. Every number passes the Luhn checksum used to format real cards, but it isn't tied to any bank, account, or cardholder. No payment network will authorize a charge against it.

Can I use a Luhnly number to make a purchase?

No. These numbers are synthetic and aren't linked to any real account, so they can't successfully authorize a real transaction. They exist to test whether your own form or code validates card-number formatting correctly — not as official payment-provider sandbox credentials.

What is the Luhn algorithm?

A public checksum formula from 1954 (also called mod-10) used to catch mistyped digits in identification numbers, most commonly credit cards. See the walkthrough above for the step-by-step math.

Is it legal to generate test card numbers?

Yes. Generating Luhn-valid numbers for testing and education is standard, legal practice. It would only become a legal problem if someone tried to use them to commit fraud — which isn't possible here, since they aren't linked to real accounts.

Does Luhnly store the numbers I generate?

No. Generation happens locally in your browser via JavaScript. Nothing is transmitted to or stored on a server.

A Credit Card Generator Built for Testing, Not Transactions

Search "credit card generator" and you'll find dozens of tools with very different intentions behind them. Luhnly is built specifically for the legitimate side of that search: developers and QA engineers who need fake credit card numbers that are structurally correct — right length, right prefix, right checksum — without any of them ever being usable for a real purchase.

If you landed here searching for a fake credit card number generator, a test credit card number generator, or a dummy card number for testing, this tool does exactly that — and nothing more. No account required, no data leaves your browser, and no generated number is tied to a real account or capable of authorizing a real charge.

About Luhnly

Luhnly started from a simple frustration: most credit card generators bury a straightforward utility under ad clutter, sketchy pop-ups, or no clear indication of who built them or why. Luhnly is the opposite — a fast, single-purpose tool that does exactly one thing well, with nothing hidden and nothing tracked beyond basic, disclosed analytics.

Every number is generated locally in your browser using the same public Luhn checksum formula real card issuers rely on. There's no backend, no database, and no account — which means there's also nothing of yours to leak.

Luhnly is independently built and maintained. If you spot a bug, have a feature request, or just want to say hello, reach out at hello@luhnly.com.

Other tools we maintain

Luhnly is one of a small set of independent tools we build and maintain. If you also need to check whether a QR code is safe before scanning it, CheckThisQR is a free QR code safety checker we maintain as well.