I'm making a simple JS game that needs a list of English dictionary words. Will I need to build the list myself, or is it possible to access the system's or browser's spell-check dictionary - or maybe there's another solution?
-
Have you checked out this? http://dreamsteep.com/projects/the-english-open-word-list.html You could at least get the words from that list which would remove the task of handwriting every single word. – MoRe Jul 15 '12 at 16:31
-
5Use the list from a friendly neighborhood Linux installation. `/usr/share/dict/words` has almost 100,000 words in it. – Pointy Jul 15 '12 at 16:31
-
That English Open Word List looks great! But somewhat dated...looks like it hasn't been updated in 15 years (not a HUGE deal, but yes, lots of words get added each year) – DA. Dec 29 '13 at 23:17
-
You can take a look at Aspell as well. It has english dictionary (ftp://ftp.gnu.org/gnu/aspell/dict/0index.html). To dump world list from the dictionary checkout http://superuser.com/questions/137957/how-to-convert-aspell-dictionary-to-simple-list-of-words. – Nemanja Trifunovic May 16 '16 at 12:25
10 Answers
You can use Aspell English dictionary.
Aspell English dictionary is availabe at: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html.
To dump world list from the Aspell dictionary checkout:
- https://superuser.com/questions/137957/how-to-convert-aspell-dictionary-to-simple-list-of-words
- http://www.commandlinefu.com/commands/view/10619/dump-an-aspell-dictionary-as-a-word-list
- http://aspell.net/man-html/Dumping-the-Contents-of-the-Word-List.html
The command to dump English list of words should look something like:
aspell -d en dump master | aspell -l en expand > words.txt

- 1
- 1

- 3,017
- 1
- 17
- 20
Easiest solution that I found is getting a text or JSON file from anywhere(on web) which contains all the English words(not meanings like in dictionary). I got it from this repository, this contains a text file and a JSON file.
You can easily read data from JSON file using javascript or other programming languages.

- 446
- 2
- 7
- 15
with node you can install random-words
npm install random-words
import it and you're done:
var randomWords = require('random-words');
console.log(randomWords());

- 18,154
- 4
- 36
- 42
-
2Worth noting that Random Words includes a very small subset of the English language – jfunk Sep 21 '21 at 15:35
The wordlist for Firefox spellchecking seems to come from this repository: https://github.com/marcoagpinto/aoo-mozilla-en-dict. So you could download it there to get a word list.
You can also install the dictionary as addon (https://addons.mozilla.org/en-GB/firefox/language-tools/) but I don't know if or how the dictionary-addons can be accessed with JavaScript directly from inside the browser.

- 1,463
- 12
- 22
-
1Careful, there are some naughty and rather offensive words in here. Depending on their use, they may not be words you want appearing in your product. – Adam Grant Nov 02 '21 at 04:49
Was looking for a simple JSON endpoint I could use for a workbook - wound up uploading one to github:

- 10,370
- 10
- 62
- 81
you can to use this:
https://www.javascriptspellcheck.com/JavaScript_SpellChecking_Dictionaries
there are many languages:
Afrikaans (South Africa)
American English (USA)
Australian English
Brazil (Modern Brazilian Portuguese)
British English (UK)
Catalan (Catalonia)
Canadian English
Danish Dictionary (Dansk)
Dutch & Flemish (Nederlands)
Gaelic
German Dictionary (Deutsch)
French (Francais)
Frisian (Frysk, Seeltersk & Mooring)
International English
Italian (Italiano)
Malaysian (Bahasa Malaysia)
Portuguese (Portugues - Brazil and Portugal)
Spanish (Espanol - Americas & Spain)
Swedish (Svenska)
Welsh (Cymric)
As Linked by @aryaman , I too used that GitHub page when I needed an Array for Auto-correct TextBox. https://github.com/dwyl/english-words/blob/master/words.txt[][1]
But If you are looking for a Javascript Array Soultion, Just Create a Python File in the Same directory as The words.txt file and type this into Python File
filepath = 'words.txt'
print("var anyname = [")
with open(filepath) as fp:
for cnt, line in enumerate(fp):
print("'{}',".format(line))
print("]")
Just Copy Paste the Output to your Code File and Done !
! Note - It's really big file, I recommend you to use this one from the same respoitory https://github.com/dwyl/english-words/blob/master/words_alpha.txt[][1] . It contains words without any Numbers. Also, Python Script could take 2-3 hours, mine is currently running that's why I'm writing this. I will soon Edit The Answer with Direct Link to File if it is done !

- 15
- 3
I recently found the following npm repo which contains a list of English words from here.
https://github.com/danakt/spell-checker.js
npm i spell-checker-js
const spell = require('spell-checker-js')
// Load dictionary
spell.load('en')
// Checking text
const check = spell.check('Some text to check, blahblahblah, olololo')
console.log(check)
// -> ['blahblahblah', 'olololo']

- 7,176
- 4
- 37
- 38
you can get a worlist here http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html .. look for the WORDLIST link on the right

- 17,260
- 17
- 99
- 173
try this:
let theWord = 'green'
const validateWord = async() => {
let failed = false;
//Check if it is a valid english word
await fetch(
`https://api.dictionaryapi.dev/api/v2/entries/en/${theWord}`
).then((response) => {
if (response.status == "404") {
alert("Please Enter Valid Word");
failed = true;
}
});
return !failed;
}

- 93
- 1
- 3