A list copied out of a spreadsheet, a chat thread or your own notes rarely arrives in a useful order. Names are jumbled, numbered items run 1, 10, 2, and finding anything means scanning the whole thing. Sorting by hand works for ten lines; for two hundred it is slow and easy to get wrong.
This guide shows how to sort a list with the free Sort Lines Tool on Ovatly. It covers the seven sort modes the tool offers, the two behaviours that surprise people (natural number ordering and case-insensitive comparison), and the honest limits: sorting reorders lines, it does not clean them, deduplicate them or fix their contents.
Contents
- Quick answer
- What the sort modes actually do
- Natural ordering: why item 2 beats item 10
- Case, numbers and length: the comparison rules
- How to sort a list, step by step
- Worked example: the item 1, item 2, item 10 problem
- Limitations and alternatives
- Common mistakes
- FAQs
- Conclusion
Quick answer
Open the Sort Lines Tool, paste your list with one item per line, and choose a sort mode: A to Z, Z to A, numeric low to high or high to low, shortest or longest first, or reverse order. Read the sorted result, then copy it or download it. Sorting happens in your browser, so your list is not uploaded anywhere. Alphabetical sorting is natural, meaning numbers inside lines are compared as numbers, and it ignores case differences when comparing, so apple and Apple end up next to each other.
What the sort modes actually do
The tool gives you seven ways to order the same lines:
- A to Z sorts alphabetically in ascending order, using natural comparison.
- Z to A is the same comparison in descending order.
- Numeric low to high and numeric high to low order lines by the number each line starts with.
- Shortest first and longest first order lines by length, measured in characters, including spaces.
- Reverse order flips the current order of the lines without comparing their contents at all.
That last mode is worth understanding: reverse order does not sort, it mirrors. If your list was pasted newest first and you want oldest first, reversing is the honest tool for the job. If the list was never in any order, reversing just gives you a differently shuffled list.
Natural ordering: why item 2 beats item 10
Plain character-by-character sorting compares text one digit at a time, so it reads "item 10" as starting with "item 1" and files it before "item 2". Anyone who has sorted filenames on an older system has seen the result: 1, 10, 11, 2, 3. It is technically consistent and practically useless.
This tool's alphabetical sorting is natural instead. The numbers inside the text are compared as numbers, not as single digits, so item 1, item 2 and item 10 land in the order a person expects. If your lists contain numbered items, versions, chapters or steps, this single behaviour is the reason to use a sorter built for text rather than a generic one.
Case, numbers and length: the comparison rules
Three rules decide the details. First, alphabetical sorting ignores case differences when comparing. A line starting with a capital letter does not jump ahead of lowercase lines; apple and Apple sit next to each other, in whatever relative order they arrived.
Second, numeric modes look only at the start of the line. The first number found at the start of each line is its sort key. A line like "apples 5" has its number in the middle, so it counts as having no leading number, and lines without a leading number are placed last in numeric modes. If you want a list sorted by a quantity, put the quantity first on each line before you sort.
Third, length means characters, including spaces. A padded line with trailing spaces is longer than it looks. If a length sort produces an order that seems wrong, invisible padding is the usual cause, and trimming the lines first is the fix.
How to sort a list, step by step
- Open the Sort Lines Tool and paste your list into the box, one item per line.
- Choose a sort mode: A to Z, Z to A, numeric low to high or high to low, shortest or longest first, or reverse order.
- Read the sorted result below and scan it for anything that landed somewhere unexpected.
- Copy the sorted lines, or download them as a file, and paste them where the list belongs.
Before step 1, one preparation habit pays off: if the list may contain duplicates, sort a deduplicated copy instead. This tool does not remove duplicates while sorting, so run the list through Remove Duplicate Lines first if that matters.
Worked example: the item 1, item 2, item 10 problem
Take this input, pasted in the order it was written:
item 10
item 2
item 1
Sorted A to Z, the result is:
item 1
item 2
item 10
Nothing about the lines changed; every line keeps its exact original text. Only the order moved, and it moved the way a reader expects, because the numbers inside the text were compared as numbers. The same list under Z to A comes back item 10, item 2, item 1. Under numeric low to high it also gives item 1, item 2, item 10, since each line starts with its number. Under shortest first, all three lines are the same character length except item 10, which has one extra digit, so item 10 goes last and the two shorter lines keep their relative order at the top.
Limitations and alternatives
Sorting is one narrow job. The tool does not remove duplicate lines, does not trim stray spaces from line ends, and does not reformat the contents of any line. A list pasted from a messy source often needs cleaning before sorting gives a clean result; the wider Text and Writing Tools category covers those neighbouring jobs.
The numeric modes are equally narrow: they read one number, at the start of the line, and nothing else. A list of prices written as "5 dollars" sorts numerically; the same list written as "dollars: 5" sorts last, line after line. And because sorting happens on your device, a very long list is limited by your browser and machine rather than by any server, which is the right trade for privacy but worth knowing for enormous pastes.
Common mistakes
- Expecting duplicates to disappear. They do not. Deduplicate first, then sort.
- Sorting by a number that is not at the start of the line. Numeric modes place those lines last. Move the number to the front, or use A to Z and rely on natural ordering.
- Judging a length sort by eye. Length counts characters including spaces, so padded lines sort as longer than they look.
- Assuming capitals sort separately. Case is ignored in alphabetical comparisons, so do not expect all the capitalised lines to group at the top.
- Using reverse order as a sort. It only flips the existing order; it compares nothing.
FAQs
Can it remove duplicates while sorting? Not directly. Run the list through Remove Duplicate Lines first, then sort the cleaned result here.
How are lines with numbers in the middle handled in numeric mode? Only a number at the very start of the line counts. A line like apples 5 has no leading number and sorts last in numeric modes.
Does sorting change the lines themselves? No. Only the order changes; every line keeps its exact original text.
Why does item 2 come before item 10? Alphabetical sorting is natural: numbers inside the text are compared as numbers, not as single digits, so 2 is treated as smaller than 10.
Is my list uploaded? No. Sorting happens in your browser on your device.
Conclusion
Sorting a list well comes down to picking the mode that matches the list you actually have: A to Z for names and numbered items, numeric when every line starts with its quantity, length when you are hunting the longest entries, and reverse when the order is simply upside down. The Sort Lines Tool keeps the whole job in your browser and never alters a line, only its position. When the list you are sorting came from a copy and paste and still looks ragged after sorting, clean it first with the method in How to Clean Up Messy Copied Text Before You Use It, and browse the rest of the Text and Writing Tools guides for the neighbouring jobs.