Sort Text Lines
Sort the lines of a text alphabetically, numerically, or by length, with the option to make sorting case-sensitive and to remove duplicate lines while sorting. Perfect for lists, data, and plain-text tabular content.
How it works
- Paste the text you want to sort, one item per line.
- Choose the sort criteria: alphabetical (A-Z or Z-A), numerical (ascending or descending), or by line length.
- Enable 'Case-sensitive' if the sort order should treat uppercase and lowercase letters differently.
- Enable 'Remove duplicate lines' if you also want to strip out exact repeats while sorting.
- Copy or download the sorted result.
Use cases
- Sort a list of names, emails, or products alphabetically before sharing it.
- Sort a column of numbers pasted as plain text, from lowest to highest or vice versa.
- Sort lines by length to quickly spot the shortest or longest items.
- Clean up and sort lists exported from spreadsheets or databases in a single step.
Use cases
- Sort a list of names, emails, or products alphabetically before sharing it.
- Sort a column of numbers pasted as plain text, from lowest to highest or vice versa.
- Sort lines by length to quickly spot the shortest or longest items.
- Clean up and sort lists exported from spreadsheets or databases in a single step.
Common mistakes
- Sorting a list that mixes numbers and text with 'Numerical' mode, expecting the text to sort alphabetically within the same result.In numerical mode, any line that can't be parsed as a number is treated as zero. If your list mixes both types, use alphabetical or length sorting instead.
- Sorting without enabling 'Case-sensitive' and being surprised that 'Apple' and 'apple' are treated as the same line.By default, sorting ignores case; enable that option if you need 'Apple' and 'apple' to be sorted and compared as distinct lines.
- Assuming alphabetical order follows raw Unicode code points, leaving accented vowels out of place.This tool uses Intl.Collator configured for the sort's language, so accented letters sort according to language rules, not their raw Unicode value.
Frequently asked questions
Lines that can't be parsed as a number are treated as if their value were zero for sorting purposes. If your list mixes text and numbers, it's better to use alphabetical or length-based sorting.
Blank lines are treated like any other line: in alphabetical order they usually end up at the start, and in length-based order, among the shortest (zero length).
Yes. If the option is enabled, 'Apple' and 'apple' are treated as different lines both for sorting and for duplicate detection. If it's disabled, they're treated as the same line.
No. Sorting and duplicate removal happen entirely in your browser. Your data is never sent to an external server.
Alternatives
In the terminal, the sort command (with sort -n for numbers or sort -f to ignore case) does the same thing on a file. This tool is useful for sorting a list pasted directly, with no file to save or terminal to open.