OmniTools
textDifficulty: 2/5

Remove Duplicate Lines

Remove duplicate lines while preserving order, with case-sensitive and whitespace-aware comparison and a report of what was removed.

Your lines are not rewritten: The options change only how lines are compared, never how the survivor is written out — case-insensitive comparison does not lowercase the survivor, and the trim option does not strip its indentation. Ordering is preserved and the output is not sorted.

How it works

  1. Paste or type a list of lines.
  2. Choose how lines are compared: case-sensitivity, whitespace handling, and whether to keep the first or last occurrence.
  3. The deduplicated output appears live as you type, with a summary of how many lines were removed and which values repeated.
Privacy & Processing: Everything runs in your browser. Nothing you enter is uploaded, stored, or sent to analytics.

Frequently Asked Questions

Does it keep the first or the last occurrence?

The first, by default, and the original order of the survivors is preserved. There is an option to keep the last occurrence instead, which still restores the original ordering rather than reversing it.

Does case-insensitive matching change my text?

No. The comparison ignores case, but the line written out is the original text exactly as you typed it. The same applies to the trim and whitespace-normalise options: they affect only how lines are COMPARED, never how the survivor is written. Rewriting the survivor would be a silent data change you did not ask for.

Can I see which lines were duplicated?

Yes. The result lists each duplicated value with how many times it appeared, sorted by frequency, so you can check the removals were the ones you expected.

Does it sort the output?

No. Ordering is untouched, which is what distinguishes this from a sort-and-unique pipeline. Use the sort-lines tool if you want both.

Related Tools