Overview
Introduction
Alphabetizing the individual words of a passage, a tag list, or a word bank is quick with a dedicated sort instead of manually reordering them by eye.
This tool does it automatically, splitting on whitespace and alphabetizing the result.
What Is Word Sorter?
A word sorter that splits text into words on whitespace and alphabetizes them using locale-aware string comparison, with an option to reverse the order.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How Word Sorter Works
The input is split into words on whitespace, sorted with localeCompare() for human-friendly ordering, optionally reversed for descending order, and rejoined with single spaces.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Word Sorter
Use it to alphabetize a word bank, a tag list typed as running text, or the words of a short passage for review.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Text Sorter and Sentence Sorter.
Features
Advantages
- Locale-aware comparison generally matches human expectations better than raw character-code sorting.
- One-click toggle between ascending and descending order.
- Filters out empty tokens before sorting, so irregular spacing cannot introduce blank entries into the result.
Limitations
- Doesn't deduplicate; repeated words remain repeated, just adjacent after sorting.
- Rejoins with single spaces, so original line breaks are lost.
Examples
Best Practices & Notes
Best Practices
- Use Text Sorter instead if your input is already one item per line and you want to keep it that way.
- Strip punctuation first, since attached commas and full stops take part in the comparison and pull words out of position.
- Normalize the case beforehand when you want every form of a word grouped together regardless of capitalization.
Developer Notes
Words are split with `split(/\s+/).filter(Boolean)`, sorted using `(a, b) => a.localeCompare(b)`, and optionally reversed for descending order, then joined with a single space.
Word Sorter Use Cases
- Alphabetizing a word bank for a worksheet
- Sorting the words of a short passage for review
- Alphabetizing a tag list typed as running text
Common Mistakes
- Expecting duplicates to be removed automatically, or line breaks to be preserved.
- Expecting duplicates to be merged; repeated words are all kept and simply end up adjacent once sorted.
Tips
- Pair with Word Filter first if you only want to sort words matching a keyword.
- Sorting brings every form of a word together, which makes inconsistent spellings and stray capitalizations easy to spot.