Jquery Mask Plugin

A jQuery Plugin to make masks on form fields and HTML elements.
Alternatives To Jquery Mask Plugin
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Selectize.js12,97060010913 days ago7July 12, 201850apache-2.0SCSS
Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.
Bootstrap Fileinput5,3011,1823524 days ago89August 17, 202218otherJavaScript
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
Jstree5,08039813613 days ago31February 19, 20232mitJavaScript
jquery tree plugin
Jquery Mask Plugin4,6512506510 months ago30July 31, 2019118otherJavaScript
A jQuery Plugin to make masks on form fields and HTML elements.
3 years ago1February 03, 2015106JavaScript
A very lightweight jQuery plugin to lazy load images
Malihu Custom Scrollbar Plugin4,110299562 years ago11July 10, 2016412otherJavaScript
Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
Jquery Placeholder4,073120113 years ago4January 12, 201629mitJavaScript
A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
Animsition3,7492134 years ago8April 26, 201676mitCSS
A simple and easy jQuery plugin for CSS animated page transitions.
Bootstrap Multiselect3,62082246 months ago4August 01, 2021302otherHTML
JQuery multiselect plugin based on Twitter Bootstrap.
Jquery Match Height3,086491285 years ago4February 19, 201778mitJavaScript
a responsive equal heights plugin
Alternatives To Jquery Mask Plugin
Select To Compare

Alternative Project Comparisons

jQuery Mask Plugin

A jQuery Plugin to make masks on form fields and HTML elements.

Build Status Code Climate jsDelivr Hits CDNJS

Documentation, Demos & Usage Examples



  • Lightweight (~2kb minified, ~1kb gziped).
  • Built-in support for dynamically added elements.
  • Masks on any HTML element (no need to server-side mask anymore!)!
  • HTML notation support (data-mask, data-mask-recursive, data-mask-clearifnotmatch).
  • String/Numeric/Alpha/Mixed masks.
  • Reverse mask support for masks on numeric fields.
  • Sanitization.
  • Optional digits.
  • Recursive Digits.
  • Fallback Digits.
  • Advanced mask initialization.
  • Advanced Callbacks.
  • On-the-fly mask change.
  • Mask removal.
  • Full customization.
  • Compatibility with React/UMD/Zepto.js/Angular.JS.
  • HTML5 placeholder support.
  • Clear the field if it not matches support.

Want to buy me a beer? 😍


Install it via Package Managers


bower install jquery-mask-plugin


npm i jquery-mask-plugin


meteor add igorescobar:jquery-mask-plugin


composer require igorescobar/jquery-mask-plugin







gem 'jquery_mask_rails' # more details at http://bit.ly/jquery-mask-gem




Fun (or not) facts


jQuery Mask Plugin has been tested with jQuery 1.7+ on all major browsers:

  • Firefox 2+ (Win, Mac, Linux);
  • IE7+ (Win);
  • Chrome 6+ (Win, Mac, Linux, Android, iPhone);
  • Safari 3.2+ (Win, Mac, iPhone);
  • Opera 8+ (Win, Mac, Linux, Android, iPhone).
  • Android Default Browser v4+

Typescript support

Definition can be found here.

To install, open terminal and navigate to your working directory.

Typescript 1.x users

  • Install typings by running npm install typings --global.
  • Then install the definition by running typings install dt~jquery-mask-plugin --global --save.

Typescript 2.x users

  • Use npm npm install --save-dev @types/jquery-mask-plugin.

For configuration options and troubleshooting refer to these repositories:

Problems or Questions?

Before opening a new issue take a look on those frequently asked questions:

How to integrate with React.js?

How to integrate with Angular.js?

How to integrate with Vue.js?

Problems with old versions of Android keyboard

Negative numbers, or currency related problems

Prefix or sufix on the Mask

Add validation?

Field type number, email not working?

Want to keep the placeholder as the user types?

E-mail mask?


Did you read our docs? Yes? Cool! So now... make sure that you have a functional jsfiddle exemplifying your problem and open an issue for us. Don't know how to do it? Use this fiddle example.


  • Bug Reporting: Yes! You can contribute opening issues!
  • Documenting: Do you think that something in our docs should be better? Do you have a cool idea to increase the awesomeness? Summit your pull request with your idea!
  • Bug Fixing: No time to lose? Fix it and help others! Write some tests to make sure that everything are working propertly.
  • Improving: Open an issue and lets discuss it. Just to make sure that you're on the right track.
  • Sharing: Yes! Have we saved some of your time? Are you enjoying our mask plugin? Sharing is caring! Tweet it! Facebook it! Linkedin It(?!) :D
  • Donating: Hey, now that you don't need to worry about masks again... buy me a coffee, beer or a PlayStation 4 (Xbox One also accepted!) :o)

Unit Tests

We use QUnit and GruntJS. To run our test suit is just run: grunt test in your console or you can open those test-for*.html files inside of our test/ folder.

In case you're familiar with Docker here is how you can use it:

docker build -t jquery-mask .
CONTAINER_ID=$(docker run -d -v $PWD:/app/jquery-mask-plugin jquery-mask)
docker exec $CONTAINER_ID sh -c "npm install"
docker exec -it $CONTAINER_ID /bin/bash
grunt test


Popular Plugin Projects
Popular Jquery Projects
Popular Libraries Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.