Text Sorter
Sort any list of lines. Natural ordering is used by default, so file10 sorts after file9 rather than before it.
How to use the Text Sorter
- Paste your lines into the input box.
- Pick a sort order and adjust the options — deduplicating while sorting is a common combination.
- Press Sort, then copy or download the result.
Natural sorting versus ASCII sorting
A plain string sort compares character by character, which puts item10 before item9 — because the character "1" comes before "9". It also sorts all capitals before all lowercase, so Zebra lands ahead of apple.
This tool uses natural ordering instead. Digit sequences are compared as numbers, and case is ignored by default, giving the order a person expects: apple, Banana, cherry, item9, item10. Switch off "Ignore case" if you need strict comparison.
Sorting text in other languages
Alphabetical order is language-specific. In Swedish, Å, Ä and Ö come after Z; in German they sort with A and O. Spanish once treated "ch" as a single letter. Sorting here uses your browser's locale collation, so the result follows the conventions of your system language.
If you need a specific language's ordering regardless of your device settings, sort in a tool where you can set the locale explicitly — a spreadsheet or a script.
Frequently asked questions
How does numeric sort handle lines with text?
It finds the first number in each line and sorts on that, so "Chapter 2" and "Chapter 10" order correctly. Lines with no number at all are placed at the end and reported in the message.
Is the shuffle truly random?
It uses a Fisher–Yates shuffle, which gives every permutation equal probability. It draws on Math.random, which is fine for shuffling a list but not suitable for anything security-related.
Can I sort by the second column?
Not directly. For column-aware sorting, paste the data into a spreadsheet. This tool treats each line as one value.
Does sorting change my text?
Only the line order, unless you enable trimming, blank-line removal or deduplication. The content of each line is never modified.
Related tools
Strip repeated lines from a list, with case and trim options.
Count words, characters, sentences and reading time as you type.
Convert text between eight cases, including programming styles.
Reverse text by character, word or line.
Compare two blocks of text and highlight what changed.