Skip to content
cosmodev ~/tools/credit-card-validator

Kreditkort-validator

Validators & Testers

Valider kreditkortnumre med Luhn-checksummen og find den udgivende brand (Visa, Mastercard, Amex, Discover, Diners, JCB, UnionPay, Maestro). 100 % på klientsiden - intet sendes nogen steder hen.

Resultat
Indtast et kortnummer for at se resultatet.
Mærke
Ukendt
Luhn-tjek
Fejlet ✗
Gyldig
Nej ✗

Runs 100% client-side - your card number never leaves your browser. Test numbers only.

(Dokumentation på engelsk)

What it does

The Credit Card Validator checks whether a card number is structurally and mathematically valid using the Luhn algorithm, and identifies the issuing brand (Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, Maestro) from the number’s prefix and length. This is exactly the kind of front-end check you’d run before submitting a payment form. Everything runs 100% client-side - the number never leaves your browser, so it’s safe even for real cards (though this tool is intended for test numbers).

How to use it

  1. Type or paste a card number into Card number (spaces and dashes are ignored).
  2. Hit Sample to load a known-valid Visa test number.
  3. Read the Luhn check and Valid results, plus the detected Brand.
  4. Copy the formatted number if you need it elsewhere.

Examples

Valid Visa test number

Input: 4111 1111 1111 1111 → Brand Visa, Luhn Pass, Valid Yes.

Invalid (off-by-one)

Input: 4111 1111 1111 1112 → Luhn Fail, Valid No.

American Express (15 digits)

Input: 3782 822463 10005 → Brand American Express, formatted 3782 822463 10005.

Good to know

  • Private: all validation is local - nothing is transmitted or stored.
  • Luhn ≠ real card: the Luhn checksumchecksumA short digest computed from a block of data, compared after transfer or storage to detect corruption. Changing one bit changes the checksum. confirms the number is well-formed, not that the account exists or has funds.
  • Related tools: IBAN Validator, HashHashA one-way function that maps data of any size to a fixed-length digest. Same input, same digest; any change, different digest; not reversible. Type Identifier.
Kildekode14 sprog

100% client-side · dine data forlader aldrig din browser. Fandt du dette nyttigt? Del det med en i dit team.