Text Sorter
Sort lines alphabetically, numerically or by length — ascending or descending.
The Text Sorter arranges any list of lines exactly the way you need: alphabetically, by numeric value, or by line length, in ascending or descending order. It is the tool for organizing word lists, cleaning up numbered exports, ranking feature requests or sorting configuration values.
The three sort methods cover the cases plain alphabetical sorting gets wrong: numeric mode extracts the number from each line so 'item 2' sorts before 'item 10' (instead of after, the classic lexicographic trap), and length mode orders lines from shortest to longest — handy for finding overly long log lines or the shortest available domain names.
Options to trim stray spaces and drop empty lines keep results clean. Everything sorts instantly and locally in your browser, with the sorted list one click from your clipboard.
Sort by
Order
How to use the Text Sorter
- Paste your lines.
- Choose the sort key: alphabetical, numeric value, or length.
- Choose ascending or descending.
- Toggle trimming and empty-line removal as needed.
- Copy the sorted output.
Frequently asked questions
Why does alphabetical sorting put '10' before '2'?
Lexicographic (dictionary) order compares character by character, so '10' sorts before '2' just as 'ab' sorts before 'b'. Numeric mode extracts and compares actual numbers instead, giving the natural 2, 3, 10 order.
What does 'numeric value' mode do with mixed text?
It finds the first number in each line (digits, optional minus and decimal point) and sorts by it; lines without any number sort to the end. 'Item 2 (5kg)' sorts by 2 — use the full line's number placement to predict results.
Does it sort case-sensitively?
The default alphabetical sort is case-insensitive with natural number awareness (like your file manager's name sort). A separate strict byte-order sort is not offered — toggle trimming and duplicates via the related tools if needed.
Related tools
View all text tools →Word Counter
Count words, characters, sentences and paragraphs as you type — with estimated reading time.
Text ToolsCharacter Counter
Count characters with and without spaces — with live platform-limit gauges.
Text ToolsSentence Counter
Count sentences and measure average sentence length for readable writing.
Text ToolsParagraph Counter
Count paragraphs, average paragraph length and empty lines in your text.
Text ToolsReading Time Calculator
Estimate how long it takes to read any article or essay.
Text ToolsCase Converter
Convert text between UPPER, lower, Title Case, sentence case, camelCase and kebab-case.