Check a payment-card number with the Luhn checksum and mask it for display.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Separators are removed, digits are walked from the right, alternating digits are doubled with nine subtracted above nine, and the total must divide by ten. Prefix heuristics label common networks while all but the first and last four digits are masked.
4111 1111 1111 1111
Valid card number Type: Visa Masked: 4111 **** **** 1111
Payment forms, checkout tests, and masked support screens use this check.