Text tools

Remove duplicate lines online.

Delete repeated lines and keep only the first of each — with options to ignore case and trim spaces.

0 lines0 chars
Result
0 lines0 chars

What removing duplicate lines does

This tool scans your text top to bottom and keeps the first time each line appears, deleting every later copy. The order of your remaining lines is preserved exactly — it de-duplicates without sorting. Two options control what counts as a match: Ignore case treats "Hello" and "hello" as the same line, and Trim whitespace ignores leading and trailing spaces so " apple" and "apple" are treated as duplicates.

What you'd use it for

De-duplication is a staple of list cleanup: trimming repeated entries from an email or subscriber list, collapsing duplicate keywords or tags, cleaning log lines, tidying a CSV column you've pasted in, or merging two lists into one clean set. Because order is preserved, it's safe to run on lists where sequence matters.

How the options change matches

With both options off, only exact character-for-character duplicates are removed. Ignore case is useful for names and emails, where capitalization varies but the value is the same. Trim whitespace catches copies that differ only by stray spaces or tabs — a common artifact of copy-pasting from spreadsheets and PDFs. The result badge tells you how many duplicates were removed.

De-duping vs. sorting

Removing duplicates keeps your original order; sorting rearranges everything alphabetically. If you want a clean, alphabetized set, run sort lines after de-duping. To randomize instead, use shuffle lines.

How to use it

Paste your lines, choose whether to ignore case and trim whitespace, and the de-duplicated result appears instantly with a count of what was removed. Copy or download it. Everything runs in your browser — nothing is uploaded.

Worked examples

Cleaning an email list. Pasted from two sign-up sheets, the same address appears with different capitals and stray spaces. With Ignore case and Trim whitespace on, they count as one:

ana@example.com
Ben@Example.com
 ana@example.com
ben@example.com
ana@example.com
Ben@Example.com

Finding what's repeated. Turn on Show only duplicated lines to list each value that appears more than once (handy for spotting double-booked names or repeated order IDs) instead of cleaning the list.

INV-104
INV-105
INV-104
INV-106
INV-105
INV-104
INV-105

Keeping the latest entry. In a log where newer lines come last, Keep last copy keeps each value's most recent position instead of its first.

Removing duplicate lines in Excel, Google Sheets or Notepad++

In Excel, select the column and use Data → Remove Duplicates. In Google Sheets, use Data → Data cleanup → Remove duplicates. Recent versions of Notepad++ have Edit → Line Operations → Remove Duplicate Lines. All three work on your file in place; this page is quicker when you just have a pasted list and want the cleaned text back. To also put the list in order, run the result through sort lines.

More text tools

Related free tools: reverse text · sort lines · remove duplicate lines · shuffle lines · fancy text · text repeater.

To remove duplicate lines, paste your list into the box. Every repeated line is deleted instantly, keeping the first copy of each in its original order. Options let you ignore case, trim spaces, drop blank lines, keep the last copy instead, or show only the lines that were duplicated.
FAQ

Frequently asked.

The first occurrence of each line is kept; every later duplicate is removed. The order of your surviving lines is unchanged.

No. Unlike sorting, de-duplication preserves your original order and simply drops the repeats.

Ignore case treats "Apple" and "apple" as the same line. Trim whitespace ignores leading and trailing spaces or tabs, so copies that differ only by stray spacing are still caught.

Extra blank lines are treated like any other line — the first blank is kept and later blank duplicates are removed. To drop blanks entirely, run the result through sort lines with "Drop blank lines" on.

Sorting reorders your lines alphabetically; removing duplicates keeps your order and only deletes repeats. They're often used together.

No. De-duplication runs entirely in your browser; your text never leaves your device.

Paste your text above. The tool keeps the first copy of every line in its original position and deletes the later repeats, so the order of what's left doesn't change.

Yes. Turn on “Show only duplicated lines” to list every line that appears more than once (each listed once), instead of the cleaned list.

Use sort lines with “Remove duplicates” ticked. It removes repeats and sorts A→Z in one step.

No fixed limit. Lists with hundreds of thousands of lines work; very large files are only limited by your browser’s memory. You can also drop a .txt file onto the box.