Runs entirely in your browser · nothing stored

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.

specimen
VISA
✓ Luhn valid
4539 1122 8890 1234
Cardholder A. TESTER
Expires 08/29
CVV 123
Luhn check: valid Charges: none possible
Ad unit — 728×90 placeholder

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
Ad unit — in-content responsive placeholder

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. Every number here is declined everywhere that matters — 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 will be declined by every merchant and processor. They exist only to test whether your own form or code validates card-number formatting correctly.

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 every number is declined everywhere it matters.

Copied