Sviluppo Web
Credit Card Validator
Verificare il numero della carta con l'algoritmo di Luhn, identificare il circuito di pagamento e la lunghezza. Tutto viene calcolato nel browser — il numero non viene inviato da nessuna parte.
The Luhn algorithm is a checksum most payment networks append to a card number to catch accidental typing errors (one transposed or mistyped digit). This tool checks a number against Luhn and identifies the payment network from its prefix (BIN).
How to use it
- Enter a card number — the Luhn check and network detection happen instantly as you type.
- Spaces and hyphens in the number are ignored automatically, so you don't need to strip them yourself.
- The tool shows the expected length for the detected network, so you can immediately see if digits are missing.
Common uses
- Validating a payment form on the frontend before submission — a basic sanity check before hitting the payment gateway.
- Generating test card numbers for development and QA (with a correct checksum, but not tied to real accounts).
- Quickly checking whether a manually entered number is just a typo-riddled string of random digits.
Things to keep in mind
A card passing the Luhn check doesn't mean it's active, unblocked, or even real — the check only catches obvious typing mistakes.
Card data is processed entirely in your browser and never sent anywhere, but for actual payments, always use a certified payment form (PCI DSS) rather than pasting a real card number into a third-party tool.
Domande frequenti
Un controllo superato significa che la carta è reale e ha fondi?
No — questo strumento verifica solo il checksum di Luhn e la lunghezza di cifre prevista per la rete rilevata; non può dire se la carta esiste realmente, è attiva o ha fondi, poiché ciò richiede di contattare l'emittente della carta.
Come funziona l'algoritmo di Luhn?
Raddoppia ogni secondo numero da destra, somma le cifre dei risultati insieme alle cifre non modificate, e verifica che il totale sia un multiplo di 10 — cattura la maggior parte degli errori di battitura e delle cifre trasposte ma non è un controllo antifrode.
Il mio numero di carta viene inviato da qualche parte?
No, la convalida avviene interamente nel tuo browser e il numero non viene mai trasmesso o memorizzato.
Come si identifica il circuito di pagamento (Visa, Mastercard, ecc.) dal numero di carta?
Dalle prime cifre del numero, chiamate BIN (Bank Identification Number) — ad esempio i numeri Visa iniziano sempre con 4, e Mastercard con l'intervallo 51–55 o 2221–2720; i moduli di pagamento usano questo prefisso per determinare l'icona del circuito ancora prima che tu finisca di digitare il numero.
Il BIN può rivelare quale banca ha emesso la carta?
In parte — le prime 6 cifre (il BIN esteso) di solito permettono di identificare non solo il circuito di pagamento, ma anche la banca emittente specifica e il tipo di carta (debito o credito), anche se per individuare la banca con precisione servono database BIN specializzati, non l'algoritmo di Luhn in sé.