Lightweight jQuery Input Mask Plugin For Phone Numbers

File Size: 5.95 KB
Views Total: 52149
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Lightweight jQuery Input Mask Plugin For Phone Numbers

This is a lightweight (less than 2kb) and easy-to-use jQuery input mask plugin to mask and validate US (or international) phone numbers in standard input fields.

See also:

How to use it:

1. Download, unzip the plugin and then insert the JavaScript jquery-input-mask-phone-number.js after jQuery JavaScript library.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/jquery-input-mask-phone-number.js"></script>

2. Create a normal text field for the telephone input.

<input type="text" id="yourphone">

3. Call the function on the input field to mask and format the strings you typed in xxx-xxx-xxxx format.




4. Customize the format for phone numbers.


    format: '(xxx) xxx-xxxx'




  • Add support for macOS Command key


  • Fixed Tab issue


  • Bugs fixed


  • Added touchend


  • Phone mask updated


  • Fixed Mozilla Firefox backspace issue

This awesome jQuery plugin is developed by rajaramtt. For more Advanced Usages, please check the demo page or visit the official website.