Text Sorter
Sort a list of lines alphabetically, numerically, naturally or by length, with optional de-duplication. Runs in your browser, nothing uploaded.
Related tools
All Text tools →This tool runs entirely in your browser. Nothing you enter is sent to our servers, so there is nothing for us to store or see.
About the Text Sorter
Paste a list and get it back in order. Sort alphabetically, by the number each line contains, by line length, in natural order, reversed, or shuffled at random — ascending or descending, with or without case sensitivity.
Natural order is the one most sort tools get wrong. A plain alphabetical sort compares text character by character, so item10 lands before item9 because "1" precedes "9". Natural order reads each run of digits as a number, which is what you actually want for filenames, version strings, chapter headings and anything else numbered.
Alphabetical sorting uses locale-aware comparison, so accented characters sort beside their base letter instead of being exiled to the end by their code point. You can trim whitespace, drop blank lines and remove duplicates in the same pass. Everything happens in your browser.
How to use the Text Sorter
-
Paste your list
One item per line, in the left box. You can also drop a .txt file onto it.
-
Choose how to sort
Alphabetical for words, numeric when each line contains a figure, natural for anything numbered, length for finding the outliers, or shuffle to randomise.
-
Tidy up while you sort
Turn on Remove duplicates, Drop blank lines or Trim whitespace to clean the list in the same pass rather than running a second tool over it.
-
Copy or download
The sorted list appears on the right. Copy it to the clipboard or download it as a text file.
Frequently asked questions
Why does item10 sort before item9 in alphabetical order?
Because alphabetical order compares one character at a time, and the character "1" comes before "9". It is doing exactly what it was asked. Switch the mode to Natural and the digits are read as numbers instead, which puts item9 before item10 as you would expect.
What does numeric sorting do with lines that have no number?
It reads the first number it finds on each line and sorts on that. Lines containing no number at all are pushed to the end rather than treated as zero, so a heading sitting in the middle of a list of figures does not get buried among the negative values.
Does sorting respect accented and non-English characters?
Yes. Alphabetical and natural modes use locale-aware comparison, so é sorts next to e, and ß next to s. A naive sort that compares raw code points would push every accented word to the end of the list, after z.
Can it handle a very long list?
Yes. Sorting hundreds of thousands of lines happens in well under a second because it is a single pass through your browser's built-in sort. The practical limit is how much text your browser will accept in a textarea, not the sorting itself.
Is my list uploaded anywhere?
No. Sorting runs entirely in your browser and nothing is transmitted or stored. You can disconnect from the internet after the page loads and the tool keeps working.