Skip to content

Line sorter & duplicate remover

Paste a list with one item per line and get it sorted and de-duplicated instantly. Everything happens in this browser only — your list is never sent anywhere.

Runs in your browser · Nothing uploadedFree · No install

Line sorter & duplicate remover

Steps
Order

Add a list and the line counts appear here.

How to use

  1. 1Paste your list into the first box, one item per line.
  2. 2Pick the clean-up steps and the order. The result updates as you change them.
  3. 3Copy the result, or press “Use as input” to refine it further.

About this tool

The order of the steps

Whatever you tick, the steps always run in the same order: trim the spaces at both ends of each line, remove empty lines, remove duplicates, sort what is left, and finally add line numbers. Because trimming comes first, “ apple” and “apple ” become the same line and only one of them is kept.

Below the result you see the line counts before and after, for example “120 lines → 87 lines · 33 duplicates removed”, so you can check at a glance how much was cleaned up. A single newline after the last line is not counted as an extra empty line.

Alphabetical and natural number order

A → Z uses the collation rules built into your browser (Intl.Collator) for the language of this page, so words are ordered the way a dictionary would order them: accented letters sort next to their base letters instead of after “z”, and upper- and lower-case versions of a word end up together.

With “Numbers by value” on, a run of digits is read as one number. “file2” then comes before “file10”, and “Chapter 1, Chapter 2 … Chapter 10” stays in the order people expect. With it off, the text is compared character by character and “file10” sorts before “file2”, which is how many simple tools behave.

Removing duplicates keeps the first occurrence

  • When a line appears more than once, the first occurrence stays and every later copy is removed. Choose “Keep order” to remove duplicates without changing the order of the rest of the list.
  • “Ignore case” treats “Apple” and “apple” as the same line and keeps whichever came first. It also makes A → Z ignore case differences.
  • Lines that look identical but are encoded differently (for example a letter with an accent typed as one character or as a letter plus a combining mark) are recognised as duplicates too.

By length, reverse, shuffle and numbering

  • By length puts the shortest lines first. Lines of equal length keep their original order. Emoji and accented letters count as one character each.
  • Reverse lines simply flips the order, so the last line comes first — handy for logs or lists where the newest entry is at the bottom.
  • Shuffle mixes the lines with the Fisher–Yates method and your browser’s cryptographic random numbers (crypto.getRandomValues), so every possible order is equally likely. Use it for presentation orders, seating plans or a fair draw. The list is shuffled again whenever you edit it or change an option.
  • Number the lines adds “1. ”, “2. ” and so on in front of each line of the result.

Your list stays in your browser

Sorting and de-duplication are computed inside this browser. Customer names, email addresses or any other personal data you paste are never sent to a server and never stored. Closing the page discards everything.

Copying one column from Excel or Google Sheets gives one line per cell. Paste the cleaned-up result back into the sheet and each line goes into its own cell again.

Frequently asked questions

Does it work with a column copied from Excel?

Yes. Each cell of a copied column becomes one line. If you copy several columns at once, each row arrives as one line with tabs between the cells, so copy only the column you want to sort.

Why does “file10” come before “file2”?

Because “Numbers by value” is off, so the text is compared character by character. Turn it on and digits are read as numbers, giving file2 before file10.

Can I remove duplicates but keep the original order?

Yes. Set the order to “Keep order” and tick only “Remove duplicates”. Each line stays where it first appeared and only later repeats disappear.

Are lines that differ only in spaces treated as duplicates?

With “Trim spaces” on, spaces at both ends are removed before comparing, so yes. Lines whose inner spacing differs are still different lines.

Is the shuffle really random?

It uses the Fisher–Yates algorithm with cryptographic random numbers from your browser, so every order is equally likely. The result cannot be reproduced later, so copy it when you are happy with it.

Is my list uploaded or saved?

No. All processing happens in your browser and the list is never sent or stored anywhere.

All everyday tools (16) →