Words to number conversion
This words to number converter reads English number words and returns the value in digits. It is handy for cleaning up transcripts, form entries, spoken-style data and documents where amounts were typed out in full.
Example
one million two hundred thirty-four thousand five hundred sixty-seven
→ 1234567
ninety-nine point nine five → 99.95
minus forty two → -42
two dozen → 24
a hundred and one → 101
How the words are read
The converter works the way people build numbers when speaking. Words below one hundred are added together, "hundred" multiplies what came before it, and each scale word (thousand, million, billion and so on up to decillion) closes a group and adds it to the total.
two hundred forty-five thousand six
= (2 × 100 + 45) × 1000 + 6
= 245006
That also means "twelve hundred" gives 1200 and "nineteen hundred eighty-four" gives 1984.
What it accepts
- Flexible formatting: hyphens, commas, any letter case and the filler words "and" and "a" are all fine.
- Decimals: "point" followed by single digits, including "zero", "oh" and "nought": "one point oh five" is 1.05.
- Negatives: "minus" or "negative" at the start.
- Dozens: "dozen" multiplies by 12.
- Mixed input: digits can appear among words, so "five hundred and 20" is 520 and "1 million" is 1000000.
What it does not understand
- Year-style readings: "nineteen eighty-four" is read as 19 + 84 = 103, not 1984. Write "nineteen hundred eighty-four" or "one thousand nine hundred eighty-four" instead.
- Ordinals and fractions: words like "first", "twentieth", "half" or "quarter" are reported as unrecognized.
- Multi-digit decimals as words: after "point", say each digit separately. "Point twenty-five" is rejected; "point two five" works.
- Currency words: "dollars" and "cents" are not recognized, so remove them before converting.
Because one unrecognized word stops the conversion, check the error message: it names the word that caused the problem.
Checking amounts written on cheques and contracts
Legal and financial documents often state an amount twice, once in digits and once in words, and the words are what counts if the two disagree. Converting the words is a quick way to confirm they match. Strip the currency and cents notation first, because those parts are not number words:
Twelve thousand four hundred fifty and 00/100 dollars
→ remove "and 00/100 dollars"
twelve thousand four hundred fifty → 12450
One thousand and fifty pounds
→ remove "pounds"
one thousand and fifty → 1050
The second line shows British usage: "and" is simply skipped. Scale words follow the short scale used in English today, so "one billion" is 1,000,000,000. Older British texts sometimes used "billion" for a million million, so check the context of historical documents before trusting a very large result.
Tips for bulk data
Put each value on its own line; blank lines stay blank so the output lines up with your input. After converting, the number sorter can put the values in order, and the number to words converter writes them out again in a consistent style.