Test Credit Card Number Generator

Generate a fake card number compliant with the Luhn algorithm, to test your payment forms or your client-side validation — this is not a real card, it cannot be used for any payment.

Example:
"4" for Visa, "5" for Mastercard

How it works

The Luhn algorithm is used by card issuers to detect entry errors: the last digit of the number is calculated from the previous ones. This tool generates a random number whose check digit is valid, useful for testing that a form correctly accepts valid numbers and rejects invalid ones.

Can I use this number for a real purchase?

No. This number is purely fictitious: it follows the format and passes Luhn validation but isn't linked to any real bank account and will be rejected by any payment processor.

Why specify a prefix (BIN)?

The prefix (Bank Identification Number) determines the simulated card network, for example "4" for Visa or "5" for Mastercard, which lets you test the automatic card-type detection in your form.

100% local processing: the calculation runs entirely in your browser via WebAssembly, with no data sent to a server.