Sort, Dedupe and Clean Lines

Sort lines, remove duplicates and empty lines, trim spaces.

About this tool

Paste a list and clean it up: trim spaces, drop empty lines, remove duplicates (optionally ignoring case), and sort alphabetically, naturally (so item2 comes before item10), by length, in reverse, or shuffle it.

How to use it

  1. Paste a list with one item per line.
  2. Choose what to clean: trim spaces, remove empty lines, remove duplicates (optionally ignoring case).
  3. Pick a sort order: natural, A to Z, Z to A, by length, reversed or shuffled.
  4. Copy the result. The status line shows how many lines and duplicates were removed.

Questions

What is natural sort?
Natural sort compares numbers inside text by their value, so item2 comes before item10. A plain alphabetical sort would put item10 first because 1 comes before 2.
Which duplicate is kept?
The first occurrence of each line is kept and later copies are removed, so the original order is preserved unless you also sort.
Is the shuffle random enough for a draw?
It uses the browser’s cryptographically secure random generator with an unbiased Fisher–Yates shuffle, so every order is equally likely.

Something not working, or a result looks wrong? Report a problem with this tool