Text Sorter
Sort lines alphabetically with language-aware ordering, naturally (item2 before item10), by number or by length. Reverse order and remove duplicates too.
Runs entirely in your browser. Your data is never uploaded.
What is Text Sorter?
Sorts the lines of a text alphabetically, in natural order, by numeric value or by length. It uses the collation rules of the page language, so accented letters land where native speakers expect them, and can reverse the order and drop duplicates in the same step.
How to use Text Sorter
- Paste the lines to sort into the Input box.
- Pick a method in Sort by.
- Optionally tick Reverse order (Z–A), Remove duplicates, Case sensitive or Remove empty lines.
- Copy the sorted list from Output.
Example
item10 item2 item1
item1 item2 item10
Sort by: Natural
When to use Text Sorter
Use it to alphabetise names, tags, glossary entries or file lists, or to order numbered items correctly. For multi-column data such as CSV where you need to sort by a particular column, use a spreadsheet.
How Text Sorter works
Alphabetical sorting uses Intl.Collator with the current page language, e.g. on the Vietnamese page a, â, b, ơ follow Vietnamese alphabet order, and on the English page ä sorts next to a. Natural sort enables the collator's numeric option so digit runs compare by value (item2 < item10). Numeric sort reads the number at the start of each line (decimal comma or point) and puts lines without a number last. Length sort compares visible character counts, then alphabetically. The sort is stable; "Remove duplicates" drops lines that the collator considers equal.
Common Use Cases
- Alphabetising a list of names or glossary terms
- Sorting file names like img1, img2, img10 naturally
- Ordering prices or scores from lowest to highest
- Sorting lines by length to find the shortest or longest entries
- Creating a sorted list of unique tags
FAQs
Why does alphabetical sort put item10 before item2?
Alphabetically, "1" comes before "2", so item10 < item2. Choose Natural to compare numbers by value.
Which language rules are used?
The collation of the page language you are viewing. Switch the site language to sort with, for example, Vietnamese or Spanish rules.
Does case-insensitive sorting change my text?
No. It only affects the comparison; every line keeps its original capitalisation.