Sort Lines

Sort a list alphabetically, numerically, by length, or shuffle it randomly. Ascending or descending, with optional deduplication.

Remove duplicate lines
Remove blank lines

0 lines.

How it works

Your text is split on newlines and sorted with a comparator picked by the dropdown. Alphabetical order uses localeCompare, the browser's language-aware comparison, instead of raw character codes. That distinction is visible immediately: a naive code-point sort puts every capital letter before every lowercase one (so "Zebra" sorts before "apple"), and it mangles accented characters. Locale-aware comparison orders words the way a dictionary would.

Numeric sort parses each line with parseFloat and compares the numbers, which fixes the classic string-sort bug where "10" comes before "9" because "1" is a smaller character. Lines that don't start with a number are treated as 0 and grouped together. Length sort compares character counts, and shuffle uses the Fisher-Yates algorithm, which gives every ordering equal probability. That's worth a sentence: the popular sort(() => Math.random() - 0.5) trick produces biased shuffles because sort algorithms assume a consistent comparator, while Fisher-Yates walks the array once, swapping each item with a uniformly random earlier slot.

Descending order sorts ascending then reverses, dedupe runs after sorting with a Set so only exact repeats are dropped, and blank lines can be filtered before any of it. The whole pipeline is array operations on a string in your tab: no request fires when you paste or sort (verify in DevTools' Network panel), so sorting a list of names, emails, or keys never involves a server.

Common questions

What does "Numeric" sort do with non-numbers?

Any line that doesn't start with a number is treated as 0 for sorting purposes, so pure numeric lines will sort correctly to the front or back and non-numeric lines will cluster together.

Does shuffle re-shuffle if I pick it again?

Yes, changing the dropdown to Shuffle (or re-selecting it) generates a fresh random order each time using a proper Fisher-Yates shuffle, not just a cosmetic re-sort.

Is my text sent anywhere?

No, sorting happens entirely in your browser. Nothing is uploaded.