Luhn Number Generator

Generate Luhn-valid numbers of any length for testing credit card validators, account number systems, and check-digit implementations.

Generator Options

819

Digits only. Must be shorter than the total length.

1100

Quick Presets

Generated Numbers

No numbers generated yet

Configure options on the left and click Generate.

Luhn check digit calculation (step by step)

Generate a number above to see the step-by-step Luhn check digit calculation.

Copied!

Summary

Generate Luhn-valid numbers of any length for testing credit card validators, account number systems, and check-digit implementations.

How it works

  1. Set the desired total digit length (8–19 digits).
  2. Optionally enter a fixed prefix (e.g. "4" for Visa or "5" for Mastercard).
  3. Choose how many numbers to generate (1–100).
  4. Click "Generate" to produce a list of Luhn-valid numbers.
  5. The tool fills random digits then calculates the correct Luhn check digit automatically.
  6. Copy individual numbers or export the full list as plain text.

Use cases

  • Generate test credit card numbers for payment form validation.
  • Seed test databases with Luhn-valid account numbers.
  • Verify your own Luhn validation implementation against known-good inputs.
  • Create dummy IMEI codes for mobile device testing.
  • Test barcode or loyalty card scanners that check Luhn validity.
  • Understand how the Luhn algorithm constructs a check digit interactively.
  • Generate bulk test data for QA automation suites.
  • Prototype payment flows without using real card numbers.

Frequently Asked Questions

Last updated: 2026-06-09 · Reviewed by Nham Vu