Skip to content
ToolBoxGenie

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.

Direction
Options

How to use the text sorter

  1. 1Paste your lines into the input box.
  2. 2Choose a sort method and a direction.
  3. 3Optionally remove blank lines or ignore case while sorting.
  4. 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?
It treats runs of digits inside text as numbers rather than characters, so 'item2' sorts before 'item10'. Plain alphabetical sorting compares character by character, and since '1' comes before '2', item10 lands first — which is almost never what a human wants.
How are accented characters handled?
Alphabetical sorting uses the browser's locale comparison, so é sorts next to e rather than after z. This matches how a dictionary in most European languages is ordered.
What happens to lines that are not numbers in numeric mode?
They are grouped together at the end, in their original relative order, so nothing is silently lost. The summary tells you how many lines could not be parsed as numbers.