Convert numbers to words on a web page using JavaScript

Mohammed Imtiyaz Mar 16, 2015

In this tutorial you will learn to convert numbers to their equivalent words using JavaScript.

Live Demo

Note: This JavaScript function converts only integers, any float value will be automatically parsed to integer.
<!DOCTYPE html>
<html>
<head>
    <title>Convert numbers into words on web page using JavaScript</title>
    <script src="http://www.ittutorials.in/js/demo/numtoword.js; type="text/javascript"></script>
</head>
<body>
    <input id="txtNumber" type="text" name="number" maxlength="9" placeholder="0" onKeyUp="lblWord.innerHTML=convertNumberToWords(this.value)" />
    <label id="lblWord"></label>
</body>
</html>