Line Sorter
Sort lines of text
What Is This Tool?
The Line Sorter arranges the lines of a block of text alphabetically or numerically, ascending or descending. It supports case-insensitive comparison, numeric sorting for lists of numbers, and can strip out empty lines before sorting.
How to Use
Paste your text, one item per line, into the input box.
Choose a sort direction and any options.
Click Sort to see the reordered lines.
Copy or download the sorted result.
Features
- Ascending (A-Z) or descending (Z-A) sort order
- Numeric sort mode for lists of numbers
- Case-insensitive comparison option
- Option to remove empty lines before sorting
- 100% client-side — nothing leaves your browser
Examples
Input:
banana 10 Apple 2 cherry
Output (A-Z, case-insensitive):
10 2 Apple banana cherry
Common Use Cases
- Alphabetizing a list of names, tags, or keywords
- Sorting a list of numbers or scores into order
- Organizing exported data before further processing
- Preparing a sorted list for a comparison or diff
Frequently Asked Questions
How does numeric sort work?
Each line is parsed as a number using parseFloat. Lines that parse to valid numbers are compared numerically; lines that don't parse as numbers fall back to a plain string comparison.
What does case-insensitive mean here?
When enabled, comparisons ignore letter case, so "Apple" and "apple" sort next to each other instead of being separated by case differences.
Will this remove duplicate lines?
No, this tool only reorders lines. Use the Duplicate Line Remover tool if you also want to remove repeated lines.
What happens to blank lines?
By default blank lines are sorted along with everything else. Check "Remove empty lines" to strip them out before sorting.
Is my text sent anywhere?
No. Sorting happens entirely in your browser using JavaScript. Nothing is uploaded or stored.