Sorting a list alphabetically sounds like the one text job with no decisions in it, and then “item10” lands before “item2”, lowercase entries sink below uppercase ones, and “Österreich” files itself somewhere surprising. Sorting has conventions, not just an algorithm, and knowing the three that matter turns every sorted list predictable. Our free alphabetize tool applies them in your browser; this guide explains what the options actually decide.
In this guide
Natural sort: why item10 comes before item2
Plain alphabetical sorting compares character by character, and the character “1” comes before “2”, so item10 sorts before item2: the comparison never gets far enough to notice that 10 is bigger than 2. Filenames, versions, and anything numbered suffers instantly: file1, file10, file11, file2 is the classic symptom. Natural sort is the fix: it spots digit runs and compares them as numbers, producing file1, file2, file10, file11, the order humans meant. The rule of thumb writes itself: if list items contain numbers that mean quantities, sort naturally; if the text is pure words, plain alphabetical is identical anyway. The one trap natural sort cannot fix is inconsistent zero-padding, where file002 and file2 are different strings that mean the same thing; pad consistently at creation time and both sorts agree forever.
Case sensitivity: where lowercase sinks
In the character encoding computers use, all uppercase letters come before all lowercase ones, so a case-sensitive sort puts “Zebra” before “apple”, which is alphabetically absurd and computationally correct. Case-insensitive sorting, the default in any human-facing tool, compares as if everything were one case, interleaving “apple, Banana, cherry” the way a dictionary would. The choice matters in one direction only: case-insensitive is what people expect, while case-sensitive is occasionally what programmers need when the case difference is meaningful data. If a sorted list ever looks like all the capitalized entries floated to the top, the sensitivity switch is the entire explanation, and normalizing case first with the case converter dissolves the question entirely.
Accents and locales
Where does “Österreich” sort? In German conventions, ö files with o; in Swedish, ö is a separate letter after z; byte-order sorting throws it after all unaccented letters, which no human convention endorses. Most general-purpose tools sort accented letters with their base letters, the convention that surprises the fewest people, and that is the sensible default for mixed-language lists. The honest takeaway is narrower than the topic looks: for everyday lists, accent handling rarely changes anything; for genuinely multilingual data where collation conventions matter (a Swedish member registry), the destination system’s rules should win, and pre-sorting elsewhere is cosmetic. When mystery characters do interfere with sorting, the diagnostic from the text cleanup pillar applies: invisible whitespace and Unicode lookalikes sort strangely precisely because they are not what they look like.
The remaining choices
- Direction: ascending A to Z, or descending. Descending earns its keep for numbered things where biggest-first reads best.
- Length sort: shortest-to-longest, the niche option that is suddenly the whole point when staging crossword answers or testing field limits.
- Duplicates: sorting groups identical items together, which makes it the natural moment to spot and remove them; the workflow continues in the duplicates guide.
- Stability: when two items compare equal, a stable sort keeps their original relative order. You notice this exactly once, when sorting by one property and expecting a previous order to survive among ties, and then you appreciate it forever.
The opposite job: shuffling
The mirror image of sorting is deliberately random order: quiz questions, raffle entries, taste-test sequences, anywhere a predictable order would bias the outcome. The line shuffler randomizes pasted lists in the browser, and the honest footnote is that one shuffle is one random draw: re-shuffling until the order “looks right” is choosing an order by hand with extra steps. For fairness-sensitive uses, shuffle once and commit, the same discipline a deck of cards demands.
Frequently asked questions
Why does my spreadsheet sort differently than the tool?
Different defaults: spreadsheets often sort case-insensitively and treat numbers in mixed cells inconsistently. Match the settings, natural and case-insensitive both ends, and the orders converge.
How do I sort by surname when the lines are “First Last”?
Plain sorting compares from the first character, so it sorts by first name. Either restructure to “Last, First” before sorting, or split the columns in a spreadsheet; a line sorter honestly cannot know which word matters.
Should numbered lists be zero-padded?
If anything downstream sorts them plainly, yes: 01, 02, 10 sorts correctly everywhere, padded to the widest number you expect. Natural sort makes padding unnecessary, but you do not control every tool your list will meet.
Does sorting remove blank lines?
No, it sorts them, usually to the top, which is a feature in disguise: they become visible and easy to delete. Dropping empties before sorting, per the cleanup pipeline, avoids the surprise entirely.