The Number to Words Converter spells whole numbers using short-scale English — the convention used in the United States, the United Kingdom and most of the English-speaking world. The algorithm splits the absolute value into three-digit groups and labels them units, thousand, million, billion and trillion. Each group is then expanded with a small lookup table for 1–19, the tens (twenty, thirty, …) and the word 'hundred', producing forms like 'two hundred thirty-four' or 'eight hundred seven'. Useful for cheque amounts, legal documents, invoices, contract clauses and any place where a written-out figure is required alongside the digits.
Internally the input is parsed with parseFloat, floored with Math.floor and stripped of its sign; the sign comes back at the end as the prefix 'negative '. A while loop peels off the value modulo 1000 to build groups from least-significant upward, each group is converted with a recursive chunk() function, then the labelled groups are reversed and joined with commas. Because everything runs on JavaScript Numbers, integers up to 2^53 − 1 are exact — comfortably above the 999-trillion limit of the scale labels.
The scale labels go up to 'trillion', so any integer from 1 to 999,999,999,999,999 (just under one quadrillion) is fully spelled out. Above that the conversion still runs but the leading group is shown as a plain chunk without a scale word.
A leading minus prefixes the result with the word 'negative' — for example -42 becomes 'negative forty-two'. This is the convention banks and accountants use on cheques and ledgers, rather than 'minus'.
No — the input is floored with Math.floor before conversion, so 1234.9 spells out as 'one thousand two hundred thirty-four'. If you need cents or paise spelled out as words, split the number on the decimal point first and run each half separately.
Each thousands group (units, thousands, millions, billions, trillions) is built independently and joined with a comma to make long numbers easier to read aloud — '1,234,567' becomes 'one million, two hundred thirty-four thousand, five hundred sixty-seven'. This matches how the digit grouping is read.
Explore the full suite of Number tools and 290+ other free utilities at Chunky Munster.