Text Sorter
Sort lines of text alphabetically or by length, with optional deduplication.
Sorting lines alphabetically, numerically, or by length is a task that comes up in data cleaning, list management, and code organisation. This tool handles all sort modes with options for case sensitivity, reverse order, and duplicate removal — processing your text entirely in the browser.
Remove duplicates
Your result will appear here...
How to Sort Lines of Text
- Paste your text — enter the lines you want to sort.
- Choose sort order — select alphabetical (A-Z or Z-A), numerical, by length, or random.
- Click Sort — the tool rearranges all lines according to your chosen order.
- Copy the result — use the sorted text in your document, spreadsheet, or code.
Frequently Asked Questions
How does alphabetical sorting work? ▼
Alphabetical sorting compares characters by their Unicode code points. Uppercase letters sort before lowercase by default (A-Z then a-z). Case-insensitive sorting treats "Apple" and "apple" as equal. The sort is stable, meaning items that compare equal maintain their original order.
What is the difference between alphabetical and numerical sorting? ▼
Alphabetical sorting treats values as strings: "9" comes after "10" because "9" > "1" character-by-character. Numerical sorting treats values as numbers: 9 comes before 10. Use numerical sort for lists of numbers to get mathematically correct order.
Can I remove duplicates while sorting? ▼
Yes. Enable the "Remove duplicates" option to keep only unique lines. This is useful for cleaning mailing lists, deduplicating data exports, or creating unique sorted indexes.
Does sorting preserve blank lines? ▼
The tool typically moves blank lines to the top or bottom of the sorted output (since empty strings sort before any character). You can optionally remove blank lines during the sort process.
Can I sort by a specific column or field? ▼
For simple tab- or comma-delimited data, the tool sorts by the entire line. For column-based sorting of structured data, consider using a spreadsheet or our CSV to JSON tool for more precise control.
Is my text stored? ▼
No. All sorting happens in your browser. No data is sent to any server.