How to Sort Lines Alphabetically
Sorting a list alphabetically takes one click with the right tool — and it makes the list useful. Names become findable, duplicates become obvious, and the smallest and largest values sit at the ends where you can see them. Paste your lines, pick an order, and the sorted list is ready to copy.
Why sorting a list helps
A sorted list is an index
An unsorted list is a pile: you can only use it by reading every line. A sorted list is an index: you can find an item by scanning to the right neighbourhood, spot a missing entry by the gap it leaves, and see the range of values at a glance. That is why sorting is one of the most common text operations there is — guest lists, inventories, keyword lists, file names, all of them become usable the moment they are ordered.
Sorting exposes problems
Sorting also exposes problems. Duplicates sit next to each other once sorted, so a repeated name or code is suddenly visible. Typos stand out too: a name starting with the wrong letter lands in the wrong part of the list, where it looks out of place. Sorting is often the first step in cleaning a list, not just the last one.
The sort orders, explained
A to Z, Z to A, and case-sensitive
Alphabetical A to Z compares letters from left to right, and by default it ignores case, so apple, Apple and APPLE sort together. Z to A is the same comparison reversed. Case-sensitive sorting, when switched on, puts capital letters before lowercase ones, the way a computer orders them by default — useful when case carries meaning, as in some codes and identifiers.
Length and numeric sorting
Length sorting orders lines by character count, shortest or longest first, which is handy for finding the longest entry or the shortest one. Numeric sorting reads the number at the start of each line and orders by value, so 2 comes before 10 — unlike alphabetical order, where 10 comes first because the character 1 sorts before 2. Lines without a leading number sort after the numbers, alphabetically.
Sort lines alphabetically in four steps
- Copy your list. Select the lines you want to sort — one item per line — and copy them from wherever they live: a document, a spreadsheet column, a web page or a text file.
- Paste them into the tool. Open the Sort Lines Alphabetically tool and paste your lines into the Input box. Nothing is uploaded; the sorting happens in your browser.
- Pick a sort order. Choose A to Z for most lists, Z to A to reverse, shortest or longest first to order by length, or numeric when your lines start with numbers. Leave Case-sensitive off unless capital letters should sort separately.
- Click Sort Lines. The sorted list appears on the right, with each line unchanged apart from its new position. Copy it or download it as a text file.
Sorting and duplicates
Sorting and removing duplicates are natural partners. After sorting, any repeated line sits directly next to its twin, which makes duplicates visible even without a tool. Run Remove Duplicate Lines first if you want a clean list in its original order, or sort first and then remove duplicates if you want a clean alphabetical list — either way, the two operations combine into a properly tidied list.
One thing sorting never does is change the lines themselves. No text is added, removed or reformatted; only the order changes. If your list also needs cleaning — extra spaces, stray blank lines, inconsistent capitalisation — run the Text Cleaner or the Case Converter before or after sorting, depending on whether you want the sort to see the cleaned text.
Other ways to sort lines
Spreadsheets sort with one click from the Data menu, and they are the best choice when your list already lives in a sheet and has other columns to sort alongside it. Text editors like Notepad++ and VS Code have sort-lines commands, and command-line sort handles enormous files. All of them work well for their own situation.
The browser tool wins when your list is already copied as text and you want the sorted result back in seconds, without opening a spreadsheet or an editor. Paste, sort, copy — the whole job takes less time than opening the other app.
Related guides
- How to Remove Duplicate Lines (Free, Keeps the Order) — remove duplicate lines from any list, keeping the order.
- How to Check Word Frequency (Free Word Counter Table) — see which words you use most, in a sorted table.
- How to Reverse Text (Free, Characters, Words or Lines) — flip text by characters, words or lines.
Questions people ask
Why does 10 sort before 2 alphabetically?
Alphabetical sorting compares characters, not values, and the character 1 comes before 2. Use the numeric sort order when your lines start with numbers.
Does sorting change the text of my lines?
No. Sorting only changes the order. The text of each line is left exactly as it was, including any spaces inside it.
What does case-sensitive sorting do?
With it on, capital letters sort before lowercase ones, so Banana comes before apple. With it off, which is the default, case is ignored.
Are equal lines kept in their original order?
Yes. Lines that compare as equal keep the order they had in your input, so a sort is stable and never shuffles identical lines.