Skip to content
Tools

Luhn Validator & Generator

Validate a Luhn checksum and generate valid test numbers.

Local

What this tool does

This tool checks whether a number passes the Luhn checksum, names the likely card scheme, and can generate a fresh Luhn-valid number for test data.

What the Luhn check is

The Luhn formula is a simple check digit used by payment card numbers and many account and identifier schemes. It catches most single-digit typos and transpositions. Passing the check does not mean a number is real or active, only that its final digit is consistent with the rest.

Test data, not real cards

Use generated numbers as synthetic test data. They are structurally valid but are not issued to anyone, so they are safe for fixtures and form testing. Never put a real payment card number into any tool, including this one.

Common use cases

  • Generating a valid-looking card number for a form or fixture.
  • Checking that validation accepts and rejects the right numbers.
  • Confirming an identifier's check digit.

Frequently asked questions

Are generated numbers real cards?
No. They are structurally valid but not issued to anyone, so they are safe synthetic test data. Never enter a real card number.
Does passing Luhn mean a card works?
No. It only means the check digit is consistent. It says nothing about whether a card is real or active.

Learning resources

Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.

Feedback welcome

Found a bug in this tool, or want it to do something it does not? Tell us and we will take a look.