UTILS.
Private by default
✓

Luhn / Card Validator

Check a number with the Luhn algorithm and detect the card brand by prefix.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Validate a number with the Luhn check digit algorithm and guess the card brand, entirely in your browser.

Spaces and hyphens are removed first, so a number can be pasted as printed. If anything but digits remains, the result reads not a number. The check starts at the rightmost digit, doubles every second digit going left, subtracts 9 from doubled values above 9, and passes when the total is a multiple of 10.

Brand detection is separate and uses only prefix and length. Visa: starts with 4, 13, 16 or 19 digits. Mastercard: 51 to 55 or 2221 to 2720, 16 digits. American Express: 34 or 37, 15 digits. Discover: 6011 or 65, 16 or 19 digits. A brand can show even when the checksum fails.

Frequently asked questions

Does a valid result mean a real card?
No. The Luhn check only confirms the digits form a valid checksum; it does not mean the account exists or is active.
Which brands are detected?
Visa, Mastercard, American Express and Discover, recognised by their number prefixes and lengths.
Is the number I type sent anywhere?
No. The digits are processed by the script on the page, which makes no network request.
Can I check numbers that are not cards?
Yes. Any all-digit string is tested the same way; the brand will read unknown unless it matches one of the four patterns.

More tools