Intl.InputMask 🎭 Demo

A polyfill for the Intl.InputMask 🎭 proposal.

There are commonly agreed-on rules how things like credit card numbers, International Bank Account Numbers (IBAN), or phone numbers (individual per country) should be formatted. Try the demo with one of the numbers below. Note that this does not verify the numbers for validity, it purely masks them according to the rules for each type.

(Needless to say: no information you enter is shared with the server.)

Intl.InputMask("credit-card-number").format()

Credit card test numbers

The test numbers below are masked with this library.

Credit Card Type Credit Card Number
American Express 378282246310005
American Express 371449635398431
American Express Corporate 378734493671000
Australian BankCard 5610591081018250
Diners Club 30569309025904
Diners Club 38520000023237
Discover 6011111111111117
Discover 6011000990139424
JCB 3530111333300000
JCB 3566002020360505
MasterCard 5555555555554444
MasterCard 5105105105105100
Visa 4111111111111111
Visa 4012888888881881

Intl.InputMask("international-bank-account-number").format()

IBAN test numbers

The test numbers below are masked with this library.

Country IBAN
Germany DE75512108001245126199
United Kingdom GB33BUKB20201555555555
Spain ES7921000813610123456789

Intl.InputMask("phone-number").format()

Test phone numbers

The test numbers below are masked with this library.

Country Phone number
Ireland +35315431000
Germany +4940808179000
Spain +34917486400

Intl.InputMask("isbn-number").format()

Test ISBN numbers

The test numbers below are masked with this library.

Book title ISBN number
Gesammelte Werke 3. Logik der Forschung 9783161484100
Tage der Toten 9783518463406
Der Patriot 9783608504781

Built by @tomayac. Source code on GitHub.