tooloora

Sort Lines & Remove Duplicates — local list cleanup

Sort A–Z or Z–A with natural number order, deduplicate, trim and remove empty lines — instantly in your browser.

Runs locally — nothing is uploaded

Runs entirely in your browser — no upload.

Sort lines and clean up lists — right in your browser

Paste your list and pick the operations: sort A–Z or Z–A, remove duplicates, delete empty lines, trim whitespace, reverse the order. Live statistics show lines before/after, and the result copies with one click. Everything runs locally in your browser — no upload, no signup.

In which order does the tool work?

The operations always run in this fixed order, so the result stays predictable:

  1. Trim — remove whitespace at the start/end of each line
  2. Remove empty lines
  3. Sort (A–Z or Z–A)
  4. Remove duplicates (consecutive only, or entire list)
  5. Reverse

The order is deliberate: because trimming happens first, apple and apple count as duplicates. And because sorting runs before deduplication, the "consecutive only" mode still catches every repeat whenever sorting is active.

Why "natural" sorting instead of character codes?

A naive sort by character codes gives surprising results: in ASCII, Z is code 90 and a is code 97 — so every uppercase letter sorts before every lowercase one, and file10 comes before file2 because digits are compared one by one. This tool uses Intl.Collator with numeric comparison instead: numbers sort as numbers (file2 before file10), and accented letters land next to their base letters as your language expects, instead of after z. For German lists this matches the dictionary order of DIN 5007-1 (ä sorts like a); the DIN 5007-2 variant for name registries (ä sorts like ae) is not implemented — an honest limitation.

Duplicates: "consecutive only" or "entire list"?

  • Consecutive only removes a line when it directly repeats the previous line — the behavior of the Unix classic uniq, which likewise only detects adjacent repeats.
  • Entire list removes every repeat wherever it appears; the first occurrence is kept.

With "ignore case" enabled, Berlin and berlin count as the same line — the first spelling encountered is kept. Typical uses: cleaning mailing lists, merging keyword lists, condensing log excerpts, pre-sorting CSV columns.

Does my data stay private?

Yes. Sorting and deduplication run entirely on your device — nothing is sent to a server. That makes even customer lists and address books safe to process; storage happens at most locally in your browser, so your list is still there on your next visit.

Frequently asked questions

In which order are the operations applied?

Always in this fixed order: 1. trim whitespace, 2. remove empty lines, 3. sort, 4. remove duplicates, 5. reverse. That order matters — trimming first means ' apple' and 'apple' count as duplicates, and deduplicating after sorting catches all repeats even with 'consecutive only' selected.

Is my list uploaded anywhere?

No. Sorting and deduplication run entirely in your browser on your device — nothing is sent to a server. That makes the tool safe for customer lists, email addresses or log excerpts, and it works offline.

How are numbers in lines sorted?

Naturally, using the browser's Intl.Collator with numeric comparison: 'file2' comes before 'file10'. A naive character-code sort would put 'file10' first because it compares digit by digit — and it would also sort all uppercase letters before lowercase ones, since in ASCII 'Z' is code 90 and 'a' is code 97.

What is the difference between the two duplicate modes?

'Consecutive only' removes a line just when it directly repeats the previous line (like the Unix tool uniq); 'entire list' removes every repeat wherever it appears, keeping the first occurrence. Combined with sorting, both give the same result.

Does 'ignore case' affect duplicates too?

Yes. With the option enabled, 'Berlin' and 'berlin' are treated as the same line when sorting and when removing duplicates; the first occurrence is kept in its original spelling.