Text Sorter
Text Tools · Added 10 July 2026
Sort a list of lines the way you actually meant. Alphabetical sorting is locale-aware, numeric sorting understands decimals and negatives, and natural sorting puts item2 before item10 instead of after it.
How to use the text sorter
- 1Paste your lines into the input box.
- 2Choose a sort method and a direction.
- 3Optionally remove blank lines or ignore case while sorting.
- 4Press Sort and copy the result.
Examples
Natural sort
- Input
- file10.txt, file2.txt, file1.txt
- Result
- file1.txt, file2.txt, file10.txt
A plain alphabetical sort would put file10 second.
By length
- Input
- A list of headline options
- Result
- Shortest first, making it easy to find ones that fit a character limit.
About the text sorter
Sorting is not one operation
'Sort this list' hides at least four different intentions. Alphabetical for names, numeric for quantities, natural for anything with an index in it, and by length when you are fitting text into a constrained space.
Choosing the wrong one produces output that looks sorted and is subtly wrong — the most dangerous kind of error, because nobody checks a list that appears to be in order.
Sorting before comparing
A common use for sorting is preparing two lists to be diffed. If both are sorted and deduplicated the same way, a line-by-line comparison reveals exactly what is present in one and missing from the other.
Do the normalisation identically on both sides — same case handling, same trimming, same sort — or the diff fills with false differences that have nothing to do with the data.
Frequently asked questions
What is a natural sort?
How are accented characters handled?
What happens to lines that are not numbers in numeric mode?
Related tools
Remove Duplicate Lines
Text Tools
Strip duplicate lines from a list, with options for case sensitivity and trimming.
Text Cleaner
Text Tools
Strip extra spaces, blank lines, line breaks, HTML tags, punctuation and smart quotes.
Case Converter
Text Tools
Convert text between upper, lower, title, sentence, camel, snake, kebab and more.