Skip to content
Categories
Sort Lines
Sort lines of text in ascending, descending, or numeric order.
Overview
- Sorts each line of text in lexical (string) ascending/descending order, or numeric ascending/descending order.
- The original input is left unchanged, and the sorted result is shown in a separate field, so you can try and compare different orderings.
- When lexical order is selected, you can also toggle whether the sort is case-sensitive.
Usage
- Enter the text you want to sort into the text area (the input itself is not changed).
- Choose the order (ascending or descending) and the sort method (lexical or numeric).
- Click the "Sort" button to display the result in a separate field.
Example
Input
banana apple cherry
Output
apple banana cherry
Use Cases
- Organizing a list of names or tags in alphabetical order
- Sorting a list of numbers (prices, scores, etc.) by their correct numeric order
- Ordering a list of lines extracted from a CSV or log to make them easier to compare
FAQ
How does numeric order sort the lines?
Each line is interpreted as a number and sorted by numeric value. Lines that cannot be interpreted as numbers are grouped at the end.
Is the sort case-sensitive?
When lexical order is selected, you can toggle this behavior with the "Case-sensitive" checkbox.
Does the original input change?
No. The input field is left untouched, and the sorted result is shown in a separate field.
Notes
- When numeric order is selected, lines that cannot be interpreted as numbers are grouped at the end.
- Case sensitivity can only be toggled when lexical order is selected (it has no effect on numeric order).
- The content of the original input field is not changed. The sorted result is shown in a separate field.
Related Tools
Remove duplicate lines from text.
Count the characters, words, and lines in your text.
Convert text to camelCase, snake_case, and other naming conventions.