# Remove Duplicate Lines

> Remove duplicate lines from any text or list instantly. Options to preserve order, trim whitespace, and ignore case sensitivity.

- Open the tool: https://overtooled.com/remove-duplicates
- Category: Text Tools
- Privacy: Runs entirely in your browser. Nothing is uploaded, no account is needed, and it works offline once loaded.
- Price: free, no sign-up
- Keywords: duplicate, remove, unique, lines, dedup

## In short

Remove duplicate lines from lists and text instantly.

## Overview

Removes duplicate lines from a list and keeps the first occurrence of each line in its original order. Use it to clean email lists, keywords, IDs or any one-item-per-line data.

## Features

- Keeps the first occurrence of each line and preserves order (Set-based, linear time)
- Case sensitive toggle (on by default); when off, "Apple" and "apple" are duplicates
- Trim whitespace toggle (on by default): trims leading and trailing spaces from every line before comparing
- Counts of original lines, unique lines and lines removed
- Live results; copy and pipeline buttons on the result; Clear button on the input

## How to use it

1. Paste your list, one item per line.
2. Set Case sensitive and Trim whitespace as needed.
3. Copy the unique lines from the Result box.

## Inputs

- Text with one item per line

## Outputs

- Unique lines (newline-separated) and original/unique/removed counts

## Limits and notes

- With Trim whitespace on, the output lines are trimmed too, not just compared trimmed.
- Blank lines are treated like any other line, so one blank line is kept and the rest are removed.
- Compares whole lines only; it does not split comma-separated values.
- Windows (CRLF) line endings are converted to LF, and a trailing line break is not counted as an extra line.
- Text is not saved and nothing is uploaded.

## Questions and answers

### How does the Duplicate Line Remover work?

The tool splits your text into lines, then iterates through them while maintaining a Set of seen values. Each line is checked against the Set -- if it has been seen before, it is removed; otherwise it is kept and added to the Set. When case-insensitive mode is on, the lookup key is lowercased before comparison. This preserves original order while running in linear O(n) time.

### Does it preserve the original order?

Yes. By default, the first occurrence of each line is kept in its original position and subsequent duplicates are removed.

### Is the comparison case-sensitive?

By default, yes. "Apple" and "apple" are treated as different lines. You can toggle case-insensitive mode to treat them as duplicates.

### Can I remove duplicates from a CSV or spreadsheet column?

Yes. Paste the column values one per line and the tool removes duplicates. You can then paste the cleaned list back into your spreadsheet.

## Related tools

- [List Comparer](https://overtooled.com/list-comparer.md): Compare two lists to find unique, common, and missing items
- [Sort Lines](https://overtooled.com/sort-lines.md): Sort lines alphabetically, numerically, by length, or reversed
- [Text Formatter](https://overtooled.com/text-formatter.md): 36 text transforms: delimiter swaps, line sorting, whitespace cleanup, HTML stripping, email/URL extraction, and more
- [Alt Code / Special Character Builder](https://overtooled.com/alt-code.md): Browse, search, and build strings from special characters and their Alt codes

---
Overtooled: 179 free tools that run in your browser. Index of all tools: https://overtooled.com/llms.txt
