Free online text tool

Remove Duplicate Lines

Remove Duplicate Lines keeps only the unique lines of your text and removes the repeated ones. Paste your lines, click the button and copy the result. It is free and runs in your browser.

Remove Duplicate Lines Tool

0Character Count
0Character Count (without spaces)
0Word Count
0Sentence Count
0Paragraph Count
0Line Count

Remove Duplicate Lines Example

Before
This is line 1
This is line 2
This is line 3
Hello
Hello
After
This is line 1
This is line 2
This is line 3
Hello

Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.

Suggest a New ToolProvide Feedback on This Tool

What does Remove Duplicate Lines do?

This tool keeps only the unique lines of your text and removes every repeated line. The first copy of each line is kept, and the lines stay in their original order.

A line is removed when the same line appeared anywhere above it, even if other lines come in between. By default case and spaces count, so Hello and hello are different. Tick Ignore case or Ignore spaces at the start and end of lines to compare more loosely.

Use it to clean up lists of names, emails, URLs or keywords, to tidy log files, or to merge lists without repeats.

Remove duplicate lines examples

Each example shows the lines before and after. Both options are off unless the example says otherwise.

CaseBeforeAfter
Example
This is line 1
This is line 2
This is line 3
Hello
Hello
This is line 1
This is line 2
This is line 3
Hello
Duplicates that are not next to each other
apple
banana
apple
cherry
banana
apple
banana
cherry
Case matters (option off)
Hello
hello
HELLO
Hello
hello
HELLO
Ignore case (option on)
Hello
hello
HELLO
Hello
Ignore spaces at line ends (option on)
a
  a  
a
a
Empty lines
x

y

x
x

y
No duplicates
one
two
one
two

How to remove duplicate lines

  1. 1
    Add your lines
    Paste your text into the box, one item on each line, or import a text file.
  2. 2
    Choose the options
    Tick Ignore case or Ignore spaces at the start and end of lines if you need them.
  3. 3
    Click Remove Duplicate Lines
    The repeated lines are removed and the unique lines stay. Use Undo if you change your mind.
  4. 4
    Copy it
    Click Copy and paste the result where you need it.

When to remove duplicate lines

Good for

Cleaning lists of names, emails, URLs and keywords, tidying log files, and merging lists without repeats.

Check first

Put one item on each line. The first copy of a line is kept. Case and spaces count unless you tick the options. Repeated empty lines are reduced to one. The result replaces your text, so use Undo if you need the original.

Other tools

To remove repeated words try Remove Duplicate Words. To remove empty lines try Remove Empty Lines. To sort the lines try Alphabetical Sort.

Remove duplicate lines FAQ

What does the Remove Duplicate Lines tool do?

It keeps only the unique lines of your text and removes every repeated line. The first time a line appears it is kept, and later copies are removed.

How do I remove duplicate lines?

Paste your text, one item on each line, then click Remove Duplicate Lines. The unique lines stay in the box. Click Copy to use them, or Undo to go back.

Which copy of a repeated line is kept?

The first one. Your lines stay in their original order, so only the later copies are removed.

Does it remove duplicates that are not next to each other?

Yes. A line is removed if the same line appeared anywhere above it, not only right above it.

Is it case sensitive?

By default yes, so Hello and hello are different lines. Tick Ignore case to treat them as the same line.

What about spaces at the start or end of a line?

By default they count, so a and a with a space after it are different lines. Tick Ignore spaces at the start and end of lines to compare lines without those spaces.

What happens to empty lines?

An empty line is a line like any other, so repeated empty lines are reduced to one. To remove all empty lines use Remove Empty Lines.

What if there are no duplicates?

Your text is left as it is and you see the message No duplicate lines found.

Is this tool free and is my text private?

Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.

Looking for more text tools?

Browse Remove Tools

Last updated: 10 November 2026