Text Sorter & Deduplicator

One input per line. Output is numbered to match the input order.
Pinned tools are listed in your favourites on the home page.Copies a link to this tool that carries your current input, so it opens ready to run.Gives you an iframe snippet for putting this tool on your own site.
Ctrl+Enter Run  · Ctrl+Shift+C Copy  · Esc Clear

Understand Text Sorter & Deduplicator

Sorts lines of text alphabetically, removes duplicates, trims whitespace, and reverses order.

How it works

The input is split on newlines and each line is treated as one item. Deduplication runs before sorting and keeps the first occurrence of each value, so it preserves original order when sorting is off. Comparison uses the browser's locale-aware collation rather than raw code-point order, which is why accented letters sort next to their base letter — "ä" lands beside "a" rather than after "z", where a naive byte sort would put it. Case sensitivity is a switch: when it is off, both the comparison and the duplicate check fold to lowercase.

When to use it

  • Alphabetizing an import list, an allowlist, or a set of environment variable names before committing it
  • Collapsing a pasted column of IDs or emails down to the unique values
  • Cleaning a list copied out of a spreadsheet or a PDF, where every line carries trailing spaces
  • Producing a stable, sorted list so that two versions of a file can be diffed meaningfully

Watch out for

  • The sort is alphabetical, not numeric. "10" sorts before "9" because the comparison is character by character — pad numbers with leading zeros first if you need numeric order.
  • Case-insensitive deduplication keeps whichever variant appeared first. Feed it "Apple" then "apple" and you keep "Apple"; reverse the input and you keep "apple".
  • Trimming is on by default and it is destructive for indentation-sensitive text. Turn it off before sorting YAML, Python, or Markdown lists.
  • Locale collation is not byte order. If the consumer of your list is a program that compares bytes — a database index, a Git-tracked file, `sort` in a shell script — the two orderings can disagree.

Frequently Asked Questions

How does case-insensitive sorting work?

Case-insensitive sort compares lines using lowercase values, so "Apple" and "apple" are treated as equal. If deduplication is also enabled, only one of the case variants is kept (the first occurrence in the original order).

How do I deduplicate a list while keeping order?

Enable "Remove duplicates" and disable sorting. Lines are processed in order; the first occurrence of each unique line is kept, subsequent duplicates are removed. Case sensitivity affects what counts as a "duplicate".

Can I sort numerically?

The current sort is lexicographic. "10" sorts before "9" because "1" < "9". For proper numeric sort, pad numbers with leading zeros before sorting, then remove padding afterwards. Future versions will add a native numeric sort mode.

How to Use Text Sorter & Deduplicator

  1. Paste or type your input in the input area above.
  2. The tool processes your input automatically or click Run.
  3. Copy or download the result using the action buttons.
  4. Use Ctrl+Enter to run quickly from the keyboard.