Trie Visualizer

Paste words, build a prefix tree, then visualize exact search, prefix paths, and autocomplete matches.

Words
8
Nodes
15
Terminals
8
Depth
4

Word input

Paste words on separate lines, or separate them with commas or spaces.

Search and autocomplete

Current words

catcarcartcaredogdoordovedot

Trie diagram

Sample trie loaded. Search a word or run autocomplete for a prefix.

Path Word
Trie diagramCurrent trie built from 8 words.etrtacgrotevodroot

Matches

Run autocomplete to list words that share the current prefix.

Prefix path

Search a word or prefix to highlight the route from the root node.

What is a Trie Visualizer?

A trie visualizer builds a prefix tree from a list of words. It shows how words share prefixes, where complete words end, and how prefix search or autocomplete walks through the structure.

Tries are commonly used for autocomplete, dictionaries, spell-checking, routing, and search suggestions.

For related tree, graph, and sorting tools, browse the Data Structure Visualizers hub.

How to use this trie visualizer

  • Paste one word per line or use a comma-separated list.
  • Click Build trie to draw the prefix tree.
  • Enter a word or prefix.
  • Use Search word to check for an exact match.
  • Use Autocomplete to highlight a prefix path and list matching words.

The root node is shown as root. Each child node represents one character.

Trie vs binary tree

A trie is not a binary tree. Each node can have many children, one for each next character. If you want to visualize a two-child tree, use the Binary Tree Visualizer.

If you are studying search suggestions, compare this tool with the Search Suggestions System in Python guide.

Frequently Asked Questions

What input does the trie visualizer accept?
Paste words separated by new lines, commas, or spaces. The tool normalizes words to lowercase letters and keeps the first 40 unique words.
Can I use this for autocomplete examples?
Yes. Enter a prefix and the tool will highlight the matching path and list completions from the current trie.
What does a terminal node mean?
A terminal node marks the end of a complete word. A node can be both a prefix and the end of a word.
Does this tool run locally?
Yes. The trie is built and searched in your browser without uploading your input.

Related tools