Sort Lines
Sorted result
Other tools in Text Tools
About Sort Lines
Sort Lines takes a block of text — one entry per line — and puts it into alphabetical or numeric order. It's one of those tasks that's trivial in a spreadsheet but surprisingly annoying in a plain text editor, which is exactly the gap this tool fills: paste in a messy list and get an ordered one back in a click, without opening Excel or Google Sheets just to sort a dozen lines.
Beyond a basic A-to-Z sort, this tool handles the edge cases that trip up a naive sort. "Z → A" reverses the order for a descending sort. "Case-insensitive" makes sure "Banana" and "apple" sort based on their letters rather than by ASCII value, where by default all uppercase letters sort before all lowercase ones — without this option, a list like ["banana", "Apple", "cherry"] would sort as ["Apple", "banana", "cherry"] purely because of capitalization, which usually isn't what you want. "Numeric sort" detects when your lines are actually numbers (like a list of prices, scores, or IDs) and sorts them by numeric value instead of alphabetically — without it, a plain text sort would put "10" before "9", since it compares the character "1" to "9" rather than the numbers ten and nine. "Remove empty lines" clears out blank lines before sorting, which is on by default since stray blank lines almost always end up at the very top or bottom of an alphabetical sort and rarely add value.
Typical uses: alphabetizing a list of names for a roster or credits list, sorting a list of tags or categories for consistency, ordering a set of file names or URLs before a batch operation, or sorting numeric data like scores or prices pasted from a table. As with every tool here, sorting happens instantly in your browser using JavaScript's native comparison functions, with no upload and no limit on list length.
How it works
- Paste your list. One entry per line — names, tags, numbers, file names, anything sortable.
- Set your sort options. Choose ascending or descending order, toggle case-insensitivity, numeric sorting, and whether to drop empty lines.
- Copy the sorted result. The reordered list appears below instantly, ready to copy.
Examples
Sorting names alphabetically
Input
Charlie alice Bob
Output
alice Bob Charlie (with Case-insensitive on)
Sorting numbers correctly
Input
10 2 33 4
Output
2 4 10 33 (with Numeric sort on — without it: 10, 2, 33, 4)