Skip to content
ToolFarmToolFarm
Text

Duplicate Line Remover

Remove repeated lines from a list while keeping its order. Case and whitespace rules are yours to set, all in your browser.

2 min read
Options

Was this useful?

What this tool does

Paste a list and get it back without the repeats. The order you pasted is kept by default, because most quick ways of doing this sort the list as a side effect and quietly destroy an ordering you meant to have. You decide what counts as a repeat: whether capitalisation matters, whether leading and trailing spaces are ignored, and whether blank lines are dropped. You also decide which copy survives, the first or the last, which matters when the list is in date order and the later entry is the fresher one. Whichever line survives comes out exactly as you typed it, spaces and capitals intact, because normalising your text would be an edit you did not ask for.

What you can use it for

  • Clean a pasted column of email addresses or IDs before importing it.
  • Tidy a list of URLs collected from several places.
  • Collapse repeated lines in a log excerpt so the distinct events stand out.
  • Merge two lists into one and drop whatever appeared in both.

How to use it

  1. Paste your list, one item per line.
  2. Decide whether capitalisation and surrounding spaces should count.
  3. Choose whether the first or the last copy of a repeat survives.
  4. Sort the result if you want to, then copy it.

Everything runs inside your browser. No file is uploaded to any server. See more tools in this field.

Text

Frequently asked questions

Does it change the order of my list?

Not unless you ask it to. The surviving lines stay in the order they appeared, which is the main thing that separates this from a one-line script that dumps everything into a set. Sorting is a separate option you turn on deliberately.

What is the difference between keeping the first and the last copy?

Which of the repeated lines survives, and therefore exactly how it is written. If your list has Apple then apple and you are ignoring capitalisation, keeping the first gives you Apple and keeping the last gives you apple. It also matters for lists in chronological order, where the last entry is usually the current one.

Are my lines modified in any way?

No. Ignoring spaces and capitalisation only changes how two lines are COMPARED with each other, never what is written out. The line that survives is reproduced exactly as you pasted it.

How is this different from the text comparison tool?

That one compares two separate documents against each other to show what changed between them. This one works on a single list and removes repeats inside it. Different jobs that are easy to confuse by name.