JavaScript Library To Convert Numbers To Words – numberToWordsJS

Category: Javascript | August 12, 2018
Author: ClintonMorrison
Views Total: 4,415 views
Official Page: Go to website
Last Update: August 12, 2018
License: MIT


JavaScript Library To Convert Numbers To Words – numberToWordsJS


numberToWordsJS is a simple yet useful JavaScript library for converting numbers into words equivalent. Supports both positive and negative integers.

How to use it:


$ npm install num-to-words --save

Import the module.

const numToWords = require('num-to-words');

Or load the numberToWords.js into your html page when needed.

<script src="numberToWords.js"></script>

Create an input field to accept numeric values.

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

Create a container element to output the words equivalent.

<p id="output"></p>

The main JavaScript to active the numbers to words converter.

var input = document.getElementById('input');
var output = document.getElementById('output');

input.addEventListener('input', function () {
   output.innerHTML = numberToWords(parseInt(input.value, 10));



  • Rewritten in ES6

You Might Be Interested In:

Leave a Reply