Sort Lines
Sort a list alphabetically, numerically or by length — with natural order that gets 2 before 10.
About the Sort Lines
Alphabetical sorting uses Intl.Collator rather than comparing strings directly. A plain comparison sorts by code point, which puts every capital letter before every lowercase one — so "Zebra" lands before "apple" — and files accented words like café in the wrong place entirely. Collator applies your locale's actual rules, which is what people mean by alphabetical.
Natural order is the one worth knowing about. Plain alphabetical sorting compares character by character, so item10 comes before item2 because 1 is less than 2. Natural order reads runs of digits as numbers, which puts item2 first — the way a person would file them. It is the right choice for anything with a number in it: filenames, versions, chapter headings.
Numeric mode sorts by the first number found on each line, which handles lists where the number is not at the start. Lines with no number at all sort to the end rather than being treated as zero, because scattering them through the middle of a numeric list makes them harder to find, not easier.
How it works
Paste your list, one item per line.
Pick how to sort it — alphabetical, natural, numeric, by length, or shuffle.
Trim, deduplicate and drop blank lines in the same pass.
Frequently asked questions
- Why is my list sorting with capitals first?
- That is what happens when a tool compares strings by code point, where every uppercase letter ranks below every lowercase one. Turn case sensitivity off here and A and a are treated as the same letter, which is what alphabetical order normally means.
- How do I get item2 before item10?
- Use natural order. Plain alphabetical sorting compares one character at a time, so it sees the 1 in item10 as smaller than the 2 in item2. Natural order reads whole runs of digits as numbers instead.
- Can I sort and remove duplicates at once?
- Yes — turn on remove duplicates and it runs in the same pass, before sorting. Trimming whitespace and dropping blank lines are separate toggles, and trimming first is usually what you want, since two lines differing only by a trailing space are not really duplicates.
- What does sorting by length do?
- Shortest line first, with ties broken alphabetically so the result is stable rather than arbitrary. It is useful for finding outliers in a list — the one malformed entry is usually much longer or much shorter than the rest.
- Is the shuffle actually random?
- It uses Fisher–Yates driven by the browser's cryptographic random source, which is the only method that makes every ordering equally likely. The common shortcut of sorting by a random comparator is measurably biased and varies between browsers.
Privacy
Everything happens locally. Your files are read by your own browser, processed on your device, and never uploaded — closing the tab is all it takes to erase them.
Related tools
Remove Duplicate Lines
Strip repeated lines from a list, with optional sorting and whitespace cleanup.
Extract From Text
Pull every email, URL, phone number or date out of a block of text at once.
Remove Line Breaks
Join broken lines back into paragraphs — the fix for text copied out of a PDF or email.
Find and Replace
Replace text across a whole document, with regex, whole-word and case options.
Text Diff Checker
Compare two texts side by side and see exactly what was added, removed or changed.
Word Counter
Count words, sentences and paragraphs live, with reading time and keyword density.