Web開発
Credit Card Validator
Luhnアルゴリズムでカード番号を検証し、決済ネットワークと桁数を判定します。すべてブラウザ内で計算され、番号はどこにも送信されません。
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.
よくある質問
チェックに合格することはカードが本物で残高があることを意味しますか?
いいえ — このツールは検出されたネットワークのLuhnチェックサムと期待される桁数のみを検証します。カードが実際に存在するか、有効か、残高があるかは、カード発行元への確認が必要なため判断できません。
Luhnアルゴリズムはどのように機能しますか?
右から数えて2桁ごとに2倍にし、その結果の桁数を変更されていない桁と合計し、合計が10の倍数になるかを確認します — ほとんどのタイプミスや桁の入れ替わりを検出しますが、不正検知ではありません。
私のカード番号はどこかに送信されますか?
いいえ、検証は完全にブラウザ内で行われ、番号が送信または保存されることはありません。
カード番号から決済ネットワーク(Visa、Mastercardなど)はどのように判定されますか?
BIN(Bank Identification Number)と呼ばれる番号の最初の数桁から判定されます——例えばVisaの番号は常に4で始まり、Mastercardは51〜55または2221〜2720の範囲で始まります。支払いフォームは番号の入力が完了する前でも、このプレフィックスからネットワークのアイコンを判定します。
BINからカードを発行した銀行がわかりますか?
部分的にはわかります——最初の6桁(拡張BIN)は通常、決済ネットワークだけでなく、具体的な発行銀行やカードの種類(デビットかクレジットか)も特定できますが、正確に銀行を特定するにはLuhnアルゴリズム自体ではなく、専用のBINデータベースが必要です。