Remove Duplicate Lines

Delete duplicate lines from text while keeping order and the first occurrence. Optional case-insensitive mode.

Independently verified for accuracy

Calculator by Toolsloft ↗
Duplicates removed
2

Remove repeated lines from a list or block of text while keeping the first occurrence and the original order. Paste your lines, choose whether case matters, and copy the deduplicated result. It is handy for cleaning up email lists, log lines, or keyword lists.

How this is calculated

The text is split on line breaks and each line is checked against the ones already kept. The first time a line appears it is kept; later exact repeats are dropped. With case sensitivity off, lines that differ only by letter case are treated as the same line.

How to use

  1. Paste your lines into the box.
  2. Turn case sensitivity on or off to control whether case matters.
  3. Copy the cleaned list with duplicates removed.

Examples

  • Exact repeats: a, b, a, c, b keeps a, b, c and reports 2 removed
  • Ignore case: with case off, Apple and apple count as the same line

FAQ

Does it keep the original order?
Yes. The first time each line appears it stays in place; only later duplicates are removed, so the remaining order is unchanged.
What does case-insensitive mode do?
It treats lines that differ only by capitalization as duplicates, keeping the first one exactly as you typed it.
Are surrounding spaces considered?
Yes. Lines are compared as written, so two lines that differ only by trailing spaces are treated as different lines.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.