Remove Duplicate Lines

Free remove duplicate lines tool. Strip duplicate lines from any text or list, with options for case sensitivity, whitespace trimming, and keeping blank lines.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent โ€” no API key needed.

API docs
โ€”
Paste your text above.

How remove duplicate lines works

Removing duplicate lines from a list is a common cleanup task for email lists, URLs, keywords, log files, and spreadsheet data. The tool reads the input line by line and keeps only the first occurrence of each unique line, discarding later repeats. The original order is preserved.

Three options control the behaviour. Case sensitive (default on) treats "Apple" and "apple" as different; turn it off to fold them together. Trim whitespace (default off) ignores leading and trailing spaces when comparing. Keep empty lines (default off) preserves blank lines instead of stripping them โ€” useful when blank lines carry meaning in a document.

Paste your text and click Remove Duplicates. The tool reports the original line count, the unique count, and how many duplicates were removed. It keeps the first occurrence of each line and preserves the order they appeared, which is usually what you want for cleaned lists.

Frequently asked questions

Which duplicate is kept?
The first occurrence is kept and all later repeats are removed. The original order of the remaining lines is preserved, so your list reads exactly as before but with duplicates gone.
Does it ignore case?
By default it is case-sensitive, so "Apple" and "apple" are both kept. Turn off Case sensitive to fold them together โ€” only the first spelling seen will remain.
What about blank lines?
Blank lines are removed by default to tidy up the output. Turn on Keep empty lines if blank lines matter (for example, paragraph spacing in prose).
Will leading or trailing spaces cause false duplicates?
They can. Turn on Trim whitespace to compare lines after stripping leading and trailing spaces, so " apple " and "apple" are treated as the same line.