พัฒนาเว็บ
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 และความยาวหลักที่คาดไว้สำหรับเครือข่ายที่ตรวจพบเท่านั้น ไม่สามารถบอกได้ว่าบัตรมีอยู่จริง ใช้งานอยู่ หรือมีเงินหรือไม่ เพราะต้องติดต่อผู้ออกบัตรเพื่อยืนยัน
อัลกอริทึม Luhn ทำงานอย่างไร?
มันคูณสองทุกหลักที่สองนับจากขวา รวมหลักของผลลัพธ์เข้ากับหลักที่ไม่เปลี่ยนแปลง และตรวจสอบว่าผลรวมเป็นจำนวนที่หารด้วย 10 ลงตัวหรือไม่ — จับข้อผิดพลาดในการพิมพ์และหลักที่สลับกันได้ส่วนใหญ่ แต่ไม่ใช่การตรวจจับการฉ้อโกง
หมายเลขบัตรของฉันถูกส่งไปที่ไหนหรือไม่?
ไม่ การตรวจสอบทำงานทั้งหมดในเบราว์เซอร์ของคุณ และหมายเลขจะไม่ถูกส่งหรือจัดเก็บเลย
เครือข่ายการชำระเงิน (Visa, Mastercard ฯลฯ) ถูกระบุจากหมายเลขบัตรได้อย่างไร?
จากตัวเลขไม่กี่หลักแรกของหมายเลข ที่เรียกว่า BIN (Bank Identification Number) — เช่น หมายเลข Visa ขึ้นต้นด้วย 4 เสมอ ส่วน Mastercard ขึ้นต้นด้วยช่วง 51–55 หรือ 2221–2720 ฟอร์มการชำระเงินใช้คำนำหน้านี้เพื่อระบุไอคอนเครือข่ายก่อนที่คุณจะพิมพ์หมายเลขเสร็จด้วยซ้ำ
BIN สามารถบอกได้หรือไม่ว่าธนาคารใดเป็นผู้ออกบัตร?
บอกได้บางส่วน — ตัวเลข 6 หลักแรก (BIN แบบขยาย) มักช่วยระบุได้ไม่เพียงแค่เครือข่ายการชำระเงิน แต่ยังรวมถึงธนาคารผู้ออกบัตรที่เฉพาะเจาะจงและประเภทของบัตร (เดบิตหรือเครดิต) แม้ว่าการระบุธนาคารอย่างแม่นยำจะต้องใช้ฐานข้อมูล BIN เฉพาะทาง ไม่ใช่อัลกอริทึม Luhn เอง