10 Javascript libraries for Dealing with Phone Numbers

Forms are only as good as the data they accept and that’s where validation comes in. There are various kinds of validation. What you don’t see often is telephone number validation because it’s difficult. Not anymore. So here are some Javascript libraries that will help you to add validation to your phone number input fields.

Intl Tel Input

A JavaScript plugin for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user’s country, displays a relevant placeholder and provides formatting/validation methods.

Intl Tel Input

Libphonenumber Js

A simpler (and smaller) rewrite of Google Android’s libphonenumber library in javascript.

Libphonenumber Js

Politespace

Politely add spaces to numeric form values to increase readability (credit card numbers, phone numbers, etc).

Politespace

Cleave.js

The idea is to provide an easy way to increase input field readability by formatting your typed data. By using this library, you won’t need to write any mind-blowing regular expressions or mask patterns to format input text.

Cleave.js

Faker.js

Generate massive amounts of realistic fake data in Node.js and the browser.

Faker.js

PhoneNumber.js

PhoneNumber.js is a JavaScript library to verify and format phone numbers. It is similar in purpose to Google’s libphonenumber library, with the main difference that Google’s code is some incredibly ugly spaghetti code that was cross-compiled from Java and uses around 10MB of memory.

PhoneNumber.js

JQuery Mask Plugin

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

JQuery Mask Plugin

React Telephone Input

React component for entering and validating international telephone numbers.

React Telephone Input

Vue Tel Input

International Telephone Input with Vue.

Vue Tel Input

Phoneformat.js

Javascript Phone Number Formatter.

Phoneformat.js

0 Comments

  1. Nehasays:

    Nice. For developers there is also a new website that I found on google. Code2Night is best for coding problems. Here, is the link: https://code2night.com/Blog/MyBlog?id=Card-Number-Formatting-using-jquery

Leave a comment

Please be polite. We appreciate that. Your email address will not be published and required fields are marked

This site uses Akismet to reduce spam. Learn how your comment data is processed.