My take on an efficient implementation of a Trie in Javascript
JavaScript HTML
Latest commit 78bd012 Jul 25, 2016 @mikedeboer committed on GitHub Merge pull request #2 from hwinkler/remove-using-splice
Replace trie.children.remove(idx) by trie.children.splice(idx, 1)
Failed to load latest commit information.
data initial file import May 20, 2010
test improved word fetching algo and metadata support Jul 22, 2014
mozTrie.js fixed metadata storage to be able to store multiple words Jul 28, 2014


My take on an efficient implementation of a Trie in Javascript

Short story

A Trie is a kind of digital search tree. (See [Knuth1972] for more details on digital search trees.)

[Fredkin1960] introduced the trie terminology, which is abbreviated from "Retrieval".

[Knuth1972] Knuth, D. E. The Art of Computer Programming Vol. 3, Sorting and Searching. Addison-Wesley. 1972.

[Fredkin1960] Fredkin, E. Trie Memory. Communication of the ACM. Vol. 3:9 (Sep 1960). pp. 490-499.


The trie implementation of Dennis Byrne served as a starting point and inspiration.

For more information, please take a look at the Wikipedia article


Please take a look at the file


which pretty much explains the things you can do with Trie.js in code. The test.html file uses a pure JS dataset of 44.830 records, which you can find in


More information and full documentation of the API can be found in


Amsterdam, 2010. Mike de Boer.