Duplicate Line Remover
Remove repeated lines, keeping the first or last, with optional case and space matching.
About the Duplicate Line Remover
This tool removes duplicate lines from a list or file, leaving one copy of each unique line.
You can keep either the first or the last occurrence of each repeated line, and choose whether to ignore letter case and leading or trailing spaces when comparing.
It is ideal for cleaning up email lists, log files, CSV columns and any text where the same line appears more than once.
Key features
- Keep the first or last occurrence
- Optional case-insensitive matching
- Optional ignore of leading and trailing spaces
- Shows how many lines were removed
How to use
- 1Paste your lines into the box.
- 2Choose whether to ignore case and surrounding spaces, and which copy to keep.
- 3Click Remove duplicates and copy the result.
Examples
a, b, a, c (one per line)a, b, cOnly the first appearance of each line is kept.
Frequently asked questions
- Does it change the order of lines?
- No. The remaining lines stay in their original order. Only later duplicates are removed when keeping the first, or earlier duplicates when keeping the last.
- What does ignoring case do?
- With ignore case on, lines that differ only in capitalisation, such as Apple and apple, are treated as duplicates.
- Is my text uploaded anywhere?
- No. Everything runs in your browser, so your text never leaves your device.
Continue your workflow
Open a related tool to prepare your files or refine the finished result.
- Text ToolsRemove Duplicate Words
Delete repeated words from text, keeping the first of each, with optional case matching.
Open tool - Text ToolsText Sorter
Sort lines alphabetically, by length or numerically, or reverse their order.
Open tool - Text ToolsLine Counter
Count total, non-empty, blank and unique lines, and find the longest line.
Open tool
