Sort & alphabetize lines

Paste any list, one item per line. Sort it five ways, strip duplicates and blanks, copy it back out.

How to sort and clean a list

  1. Paste your list into the box, one item per line.
  2. Click a sort: A to Z, Z to A, By length, Reverse, or Shuffle. The list transforms in place.
  3. Stack cleanup operations as needed: Remove duplicates, Remove blank lines, and Trim spaces each act on whatever is currently in the box.
  4. Click Copy result. The stats line under the buttons always shows total lines, non-empty lines, and unique lines, which doubles as a quick integrity check.

A worked example: cleaning an email list

Say you paste 8 lines: five addresses, one of them twice, plus a blank line and one address with a trailing space. The stats line immediately reads "8 lines, 7 non-empty, 6 unique" if the duplicate matches exactly. First click Trim spaces, so amy@example.com  and amy@example.com become identical. Then Remove blank lines, then Remove duplicates, and finally A to Z. You end with 5 clean, sorted, unique addresses and a stats line that confirms it: "5 lines, 5 non-empty, 5 unique." That ordering matters. Trim before deduping, because two lines differing only by an invisible trailing space are different lines to a computer, and deduping first would keep both.

What is smart about the sort

The alphabetical sort uses a locale-aware collator with two settings that fix the classic annoyances of naive sorting. It is case-insensitive, so "apple" and "Apple" sort together instead of all capitals clumping before all lowercase, and it is numeric-aware, so item2 sorts before item10 rather than after it, the way file listings have embarrassed programmers for decades. By length sorts shortest first and breaks ties alphabetically, useful for finding outliers in slugs or headlines. Dedupe keeps the first occurrence of each line and preserves the current order, which means you can dedupe without sorting, something surprisingly few list tools allow. Everything runs in your browser and the list is never uploaded.

Honest limitations

All operations replace the contents of the single text box, and there is no undo, so copy your original list somewhere before heavy surgery if you might want it back. Dedupe is exact-match after whatever trimming you have done: it will not catch Amy@example.com versus amy@example.com, since case differences make distinct lines even though the sort groups them next to each other. In practice, sort A to Z first and case-duplicates end up adjacent where you can spot them. Shuffle uses ordinary Math.random, fine for randomizing a playlist or presentation order, but for draws where fairness must be defensible, use the name picker on this site, which uses cryptographic randomness instead.

Frequently asked questions

How does alphabetical sorting handle capitals and numbers?

Sorting is case-insensitive and locale-aware, so "apple" and "Apple" sort together and accented letters land where a dictionary would put them. Lines starting with numbers sort numerically when possible: item2 comes before item10.

Can I remove duplicate lines without sorting?

Yes. "Remove duplicates" keeps the first occurrence of each line in its current order; sorting is a separate button, so you can dedupe an unsorted list.

Is my list uploaded anywhere?

No. Everything happens in your browser; the text never leaves your device.