Remove Duplicate Lines

Paste a list. Repeated lines are removed and the order of the rest is kept.

Runs on your device. Nothing you paste is uploaded.

How it works

Lines are read top to bottom and each line is kept only the first time it appears; later copies are dropped. Nothing is sorted, so the list stays in its original order. The status line tells you how many duplicates were removed.

Options

  • Ignore case — Apple and apple count as the same line. The first spelling seen is kept.
  • Ignore leading/trailing spaces — lines that differ only in surrounding spaces or tabs count as duplicates, and the output is trimmed. Almost always what you want when cleaning pasted lists.
  • Remove empty lines — drop blank lines entirely. With this off, the first blank line is kept like any other line.
  • Keep last occurrence — keep the final copy of each line instead of the first, in the position where it last appears. Useful for logs or lists where later entries supersede earlier ones.

Examples

  • Cleaning an email or ID list merged from several exports before an import.
  • Getting the unique values of a column copied from a spreadsheet.
  • Removing repeated lines from log output before sharing it.

Need the unique lines in alphabetical order? Use Sort lines with Remove duplicates on. To see what differs between two lists rather than cleaning one, use the Diff Checker.

Is my data uploaded?

No. Everything runs in your browser, so nothing you add is sent to gratistools.be. See the privacy page for details.