How to Sort Lines of Text Alphabetically
A messy list is hard to use. Names entered in no order, a jumble of items, a column of data that needs organizing — sorting lines puts them in order alphabetically or numerically so the list becomes scannable and consistent. It sounds simple, but a few details decide whether the result is what you expected. This guide explains sorting options and the gotchas that surprise people.
What sorting does
Sorting rearranges the lines of your text into order — A to Z, Z to A, or numerically. Each line is treated as an item, and the tool reorders them without changing their content. A tangled list becomes an orderly one in a click.
How to sort lines with this tool
- Open the Sort Lines tool.
- Paste your list, one item per line.
- Choose the sort order and options.
- Copy the sorted result.
Everything runs in your browser — nothing is uploaded.
The options that matter
- Ascending vs. descending — A→Z or Z→A, smallest→largest or the reverse.
- Case sensitivity — whether "apple" and "Apple" sort together or apart. Case-sensitive sorting puts all capitalized items before lowercase ones, which is rarely what people want. Case-insensitive usually reads more naturally.
- Remove duplicates while sorting — many sorting tasks also want to collapse repeats, which pairs with Remove Duplicate Lines.
The number gotcha
The classic surprise: sorting numbers *as text*. Alphabetical sorting compares character by character, so `10` comes before `2` because "1" comes before "2". A list of `1, 2, 10, 21, 100` sorted as text becomes `1, 10, 100, 2, 21` — clearly wrong for numbers. If your lines are numeric, use a numeric sort option so values order by size, not by their first digit. This trips up nearly everyone at least once.
Where sorting helps
- Alphabetize a list of names, terms, or items.
- Organize data before pasting into a spreadsheet or document.
- Prepare a list for de-duplication.
- Make a reference list easy to scan.
Related tools
Clean the list first: Remove Extra Spaces trims stray whitespace that can throw off sorting, and Remove Duplicate Lines collapses repeats. Normalize case with Convert Case so case variants sort together. Reverse the whole thing with Reverse Text if you need it flipped.
Common uses
- Alphabetize any list.
- Order data for a spreadsheet.
- Tidy a jumbled list.
- Sort numerically by value.
Privacy and limits
Sorting is fully local — no upload, nothing stored, offline once loaded. Open the Sort Lines tool to organize your list.
Try the tool
Open Sort Lines →