The messy-list problem
Every unsorted list costs time. A class register out of order, a pile of chapter titles, a stock list, a set of names pasted from three different places — you cannot scan it, you cannot check it, and you cannot trust it. Sorting by hand works for ten lines. At fifty lines, hand-sorting invites mistakes: a name skipped, a duplicate kept, two entries swapped without anyone noticing. That is the whole job of learning how to sort lines alphabetically — let the ordering be mechanical, so your attention stays on the list itself.
Try it now: Sort Lines — paste your list, pick an ordering, copy the result. Free, no sign-up, runs in your browser.
What “alphabetical” really means
Alphabetical order sounds obvious until numbers show up. There are two kinds, and mixing them up is the most common sorting mistake.
Plain character sort compares a line letter by letter, left to right. That is why, in a plain sort, “10 items” lands before “2 items”: the first character “1” comes before “2”, and the sort never looks further. Correct by the rules of characters, wrong by the rules of a human reading a list.
Natural sort reads the way people read. It treats a run of digits as one number, so 2 comes before 10, and 10 comes before 100. When you sort lines alphabetically and your list contains numbered items — file 2, file 10, chapter 9, chapter 11 — natural sort is the order you actually want. If your list is names only, both kinds agree; the moment numbers appear, the difference matters.
The six orderings, and which job each fits
The Sort Lines tool offers six orderings. Pick by the job, not by habit:
- A to Z — the default. Names, titles, any plain list you want to scan from the top.
- Z to A — the same list reversed. Useful when the newest or last item should sit at the top.
- Shortest first — lines ordered by length, short to long. Handy for spotting one-word entries in a mixed list.
- Longest first — the reverse: long lines first, quick way to find the most detailed entries.
- Numeric, low to high — lines ordered by the number each line starts with, smallest first. Quantities, prices, counts, scores.
- Numeric, high to low — the same, biggest first. Rankings, best scores, largest quantities.
Alphabetical orderings (A to Z, Z to A) use natural sort, so numbered items land where a person would expect them. Numeric orderings ignore the words and read only the leading number.
Case, duplicates and empty lines
Three small settings change the result, so set them deliberately:
- Case. By default, case is ignored: “Apple” and “apple” sort as the same word. Turn on the case-sensitive option and capitals sort ahead of lowercase, so all capitalised lines come first.
- Duplicates. The dedupe option removes repeated lines, and it runs after sorting, judged by the same case rule you chose. With case ignored, “Apple” and “apple” count as one line; with case-sensitive sorting, they count as two.
- Empty lines. Fully empty lines are dropped before sorting, so they never clutter the result. Lines holding only spaces are not treated as empty — they stay in the output. If your pasted list has stray spaces, clean them first.
Your original list stays untouched while you work; the sorted result appears in the result box, ready to copy.
The limits, stated honestly
Sorting orders characters and numbers. It does not understand meaning, and three limits follow from that:
- One item per line. A line is one item. A comma-separated line such as “apples, bananas, pears” sorts as a single item — it does not split into three. Split comma lists into one item per line first.
- Numeric sort reads the leading number. Only the number a line starts with counts. A line with no leading number counts as zero, so in a low-to-high numeric sort it floats to the top.
- Order is not importance. Sorting puts things in sequence; it cannot tell you which item matters most. That judgement is still yours.
Sorting elsewhere, briefly
In a spreadsheet, select the column and sort A to Z — but mind the header row. If the header is not marked as a header, it gets sorted into the list like any other entry. The online workflow is simpler: paste the list, choose an ordering, set the case and dedupe options, copy the result. Everything runs in the browser, so the list never leaves your device.
Worked example
Take this mixed list, the same kind the tool page itself uses as a sample:
zebra
Apple
mango
10 items
2 items
Banana
kiwi
100 items
Sorted naturally, A to Z, the result is:
2 items
10 items
100 items
Apple
Banana
kiwi
mango
zebra
Notice two things. The numbers come first, in true numeric order — 2, then 10, then 100 — not the plain-character order of 10, 100, 2. And the names follow with case ignored: Apple, Banana, kiwi, mango, zebra. The capitals do not jump ahead; the order is the order a person reading the list would expect. Eight lines in, eight lines out, sorted.
Try it yourself: Sort Lines
Try it on your own list
Ready to sort your own list? You can sort lines free with the Sort Lines tool — paste the list, choose an ordering, set case and dedupe, and copy the sorted result.