Remove duplicate lines keep each once

Paste a list and every repeated line is taken out, keeping the first of each in its place, in your browser: nothing you type is uploaded.

  • Nothing uploaded
  • As you type
  • Any language
  • Free, no sign-up

Getting ready…

Quick facts from our tests

Check it yourself: once the page has loaded, turn off Wi-Fi and mobile data, and Remove Duplicate Lines still works. Your browser's network panel (F12 on a computer) lists every request the page makes: you'll see Google's ad requests, and none of them carries your text. Our code never gives your text to the ad code. How we prove it

How to remove duplicate lines

  1. Paste the list

    One item on each line.

  2. Pick the options

    Capitals, spaces, empty lines.

  3. Copy the result

    Or download it.

When this tool isn't the right fit

  • The same item is written in different ways (spacing, spelling, format). Lines are compared character by character. Tidy spaces with Remove Extra Spaces and make the format the same first.
  • You need to remove rows with the same value in one column of a table. This tool compares whole lines. Use a spreadsheet's remove-duplicates on that column.
  • You want repeated words inside a sentence taken out. It works on whole lines only, so a repeated word inside a line stays.

Why use PDFGuild's duplicate line remover

More free tools

Private like this one: nothing you type or add leaves your device.

Remove Duplicate Lines: the complete guide

What counts as a repeat, capitals and spaces, empty lines, keeping the order, real results and tips.

In this guide
  1. What it does
  2. Step by step
  3. What counts as a repeat
  4. Real results
  5. Order and the first copy
  6. Capitals and spaces
  7. Everyday uses
  8. Opening a file
  9. Privacy
  10. Long texts
  11. Tips
  12. Limits
  13. Terms explained

What Remove Duplicate Lines does, and when you need it

Remove Duplicate Lines takes out the lines that repeat in a text and keeps the first copy of each. The lines that are left stay in the order they had, so a list keeps its shape: nothing is sorted. The result appears in the second box as you paste, ready to copy or download, with a line that says how many repeats went. The box with your own text is never changed.

Three choices decide what counts as a repeat: whether capital letters matter, whether spaces at the ends of a line matter, and whether empty lines go too. It runs in your browser: your text is never uploaded and never saved, so closing the page forgets it.

Some jobs it is made for:

  • A contact or email list pasted from several places, where the same address appears twice or more.
  • A list of names for an event, a class or a team, made from more than one sign-up sheet.
  • Keywords, tags or product codes copied from a spreadsheet, where repeats crept in.
  • Log files and lists of links, where the same line is written again and again.
  • A shopping list joined from two people's lists.

Step by step: removing repeated lines

It takes a few seconds, and the same steps work on a phone and on a computer:

  1. Put your text in the top box, one item on each line. Paste it with the Paste button, with Ctrl+V, or by pressing and holding in the box on a phone. You can also type it, choose Open a text file, or drop a text file anywhere on the page. Press Try a sample to see it on a short list of fruits first.
  2. Choose what counts as the same line. Ignore capital letters is off at first, so Apple and apple are different lines. Ignore spaces at the ends is on, so apple and apple with a space after it are the same. Remove empty lines too is on, so blank lines go.
  3. Read the line under the result. It says, for example, "1 repeated line removed; the first of each is kept." or "No repeated lines."
  4. Copy or download the result. Copy puts the whole cleaned list on your clipboard; Download saves it as a text file.

Press Try a sample: the box fills with nine lines (Mango, banana, Apple, mango, Cherry, banana, an empty line, Guava, apple). The result keeps Mango, banana, Apple, mango, Cherry, Guava and apple: the second banana is the only repeat, and the empty line goes too. Tick Ignore capital letters and mango and apple go as well, as repeats of Mango and Apple.

What counts as a repeat, exactly

The tool reads the text line by line, from the top. The first time it meets a line, it keeps it; each later line that counts as the same is taken out. The rules are written here in full, and the same rules are checked by our tests.

PartThe ruleExample
A lineEverything between two line breaks. A Windows line break counts onceEach item of a list on its own line
The same lineTwo lines with the same characters, after the two options below are applied for the comparisonbanana and banana
Ignore capital lettersOff at first. On, lines that differ only in capitals count as the sameOn: Hello World, hello world and HELLO WORLD leave one line
Ignore spaces at the endsOn at first. Spaces and tabs at the start and end of a line don't count when lines are comparedapple, apple and apple are the same
Which copy staysThe first, exactly as it was written, with its own capitals and spacesApple before apple keeps Apple
The orderThe lines that stay keep the order they had. Nothing is sortedc, a, c, b gives c, a, b
Remove empty lines tooOn at first: lines with nothing in them, or only spaces, go. Off, every empty line stays where it was, and is never counted as a repeatOff: a, empty, b, empty, a gives a, empty, b, empty
Inside a lineSpaces inside a line always count: New Delhi with two spaces is not New DelhiTidy them first with Remove Extra Spaces

Nothing else in the text changes. The lines that stay are copied exactly; only the repeats, and the empty lines when that box is ticked, are taken out.

Real results from our tests

We tested Remove Duplicate Lines with headless Chromium 148, the open-source browser Chrome is built on, on a Windows laptop with an Intel Core i7-1185G7 and 32 GB of memory, on 1 November 2026. Other work was running on the laptop at the same time, so times vary from run to run: each time below is the middle one of 3 runs.

Removing repeats is quick. It took 44 milliseconds or less to remove the repeated lines from 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with capital letters and the spaces at the ends of lines ignored and empty lines removed, the most the page takes at once.

After a text is put in the box, the page waits 0.15 second before it works, so a burst of typing is worked on once, and 0.4 second when the text has more than 400,000 characters. So the result of 500,000 characters of English showed between 0.95 and 1.09 second after it was put in the box in our test. A result of more than 100,000 characters shows only its first 100,000 in the box, and says so, because showing a very long text is slow for the browser; Copy and Download take all of it.

Checked against a second program. We removed the repeated lines from 1,500 random texts with this page's code and again with a separate Python program, with the three options on and off at random: the results were the same every time. The texts had English words, capitals, punctuation, repeated lines, empty lines and spaces at the ends of lines. Every example on this page is also one of our tests, run on the page's own code.

Size and offline. On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs.

Phone-sized screen. We also ran the tests on a phone-sized screen in headless Chromium (390 × 844 pixels, with touch). That is not a real phone. Every button, box and tick box was 44 pixels high or more, and the page did not scroll sideways. These tests don't cover Safari or Firefox.

Try it yourself: press "Try a sample" at the top of this page. It puts nine lines of fruits in the box, with banana twice and an empty line. The result has 7 lines, and the page says 1 repeated line removed; the first of each is kept. Then tick Ignore capital letters: mango and apple go too.

Try the sample

Keeping the order, and which copy stays

Many tools that remove repeats sort the list first, which mixes up your order. This one doesn't. The first copy of each line stays where it was, and later copies disappear, so a list keeps its order of arrival: the first person who signed up is still first.

Because the first copy is kept exactly as written, it matters which copy comes first. With Ignore capital letters on, apple, then Apple, then APPLE leaves apple; put Apple first and Apple stays. With Ignore spaces at the ends on, a first copy with a stray space at its end keeps that space. If you want a tidy result, tidy the list first: Remove Extra Spaces takes stray spaces out, and Case Converter can give every line the same capitals.

If you want the result in alphabetical order as well, put it into Sort Lines afterwards. Sorting first and removing repeats afterwards gives the same lines, in sorted order.

Remove Duplicate Lines after its sample: a list of fruits with its repeated line removed, the first of each kept in its place
Our sample list, with its repeated line taken out in the browser.

Capital letters, spaces and lines that look the same

Two lines can look the same on screen and still differ. The options are there for the usual causes:

  • Capital letters. Ravi Kumar and ravi kumar are the same name to a person, but different lines to a computer. Tick Ignore capital letters for names, emails and words. Leave it off for codes where capitals matter, such as some passwords or product codes.
  • Spaces at the ends. A line copied from a spreadsheet or a form often carries a space at its end that you can't see. Ignore spaces at the ends is on at first for that reason: apple, apple and apple count as one.
  • Spaces inside a line always count. New Delhi with two spaces and New Delhi with one are different lines. Make every run of spaces one space with Remove Extra Spaces first.
  • Different spellings are different lines: colour and color, or 9876543210 and 98765 43210. The tool compares characters; it doesn't guess what you meant.

Email addresses are a good case for Ignore capital letters: Ravi@Example.com and ravi@example.com almost always reach the same mailbox. Phone numbers are best tidied into one format first, without spaces, so that the same number is written the same way each time. To pull the addresses or numbers out of a longer text first, use Extract Emails.

Everyday uses

  • Merge two lists without repeats. Paste one list, then the other below it, and the repeats go. The first list's lines come first.
  • Clean a contact list before a bulk message or a mail merge, so nobody gets the same message twice.
  • Count the repeats. The note under the result says how many repeated lines went, so you know how many items were listed twice or more.
  • Tidy keywords and tags copied from several pages before you use them.
  • See how much two lists share. Remove the repeats of each list on its own, then paste the two cleaned lists together: the number of repeated lines the note gives is the number of items in both lists.

To number the lines that are left, use Add Line Numbers on the result. To see how often each word of a text appears, rather than which lines repeat, use Word Frequency Counter.

Opening a text file

Choose Open a text file, or drop a file anywhere on the page, and the tool reads it on your device. These files open: .txt, .md, .csv, .tsv, .log, .json, .xml, .srt, .vtt, .html and other plain-text files, with up to 500,000 characters. The file's name and size appear below the box with an x; press the x to remove the file's text. The file is read on your device and never uploaded. The result can be copied, or saved as a new text file; the file you opened is never changed.

  • Letters. A file saved as UTF-8 (a byte order mark at the start is dropped) or as UTF-16 with a mark is read correctly, Hindi and Tamil included. A file that is not valid UTF-8 is read as Windows-1252, and the page says so: "This file isn't saved as UTF-8, so it was read as Windows-1252. If letters look wrong, save it as UTF-8 and add it again."
  • Windows line breaks. A Windows file stores each line break as two characters. The tool reads the pair as one line break, so two lines that look the same are found to be the same, whichever system the file came from.
  • Several files. Only the first one opens, and the page says so, for example "Opening a.txt only. Open the others one at a time."
  • Not a text file. A Word, PDF or picture file renamed to .txt is not read, and the page says it doesn't look like a text file. A file named .docx, .pdf or .rtf gets this message: "Only text files (.txt and similar) can be opened here. For a Word or PDF file, copy its text and paste it into the box."
  • Empty or too long. An empty file says it is empty. A file with more than 500,000 characters is not opened, and the page says how many characters it has.

For a Word or PDF file, open it in the program you normally use, select the text, copy it, and paste it into the box. A PDF whose pages are scans holds pictures, not text, so there is nothing to copy.

Private: your text stays on your device

Your text never leaves your device. The tool runs inside your browser and has no upload step: it never sends the text you type, paste or open anywhere, and it keeps no copy of it, so closing the page forgets it. The page's Content Security Policy lets it contact only this site and Google's ad service, which pays for the site; our code never gives your text to the ad code. You can check it yourself in your browser's network panel (F12 on a computer): removing repeated lines adds no request that carries your text. The site's menu does remember the last few tools you opened, on your device.

Lists with repeats are often personal: phone numbers, email addresses, customer names or the entries of a register. This tool lets you clean them without handing them over. Our privacy policy says what we collect, and How we prove it shows how you can check our claims yourself.

Once the page has loaded, it also works with the internet switched off. In our test we switched the network off after the page had loaded and pressed Try a sample, and the result showed 0.2 seconds later or less in each of 15 runs.

Remove Duplicate Lines after its sample: a list of fruits with its repeated line removed, the first of each kept in its place, at a phone's size with the internet switched off by our test, between our test's bands that read "Internet switched off" and "Nothing uploaded: 0 requests sent data"
Proof from our testOn 9 November 2026, our test opened Remove Duplicate Lines at a phone's size, switched the internet off and ran it on its built-in sample. It finished with no connection, and none of the page's 15 requests sent any data.How we test, and how to check it yourself

Long texts

The tool takes up to 500,000 characters at once, about 500 KB of English text. What happens when a text is longer:

  • A paste that would go over the limit is not added. This holds for Ctrl+V, for press and hold, and for the Paste button. The page says, for example: "That text is very long (550,000 characters), so it was not added. The box can hold 500,000 characters. Split it into smaller parts for faster results."
  • A file with too many characters is not opened. The page says, for example: "long.txt has 550,000 characters, more than the 500,000 counted at once. Split it into smaller parts for faster results."
  • A text that gets in some other way stays, unchanged. If text is dragged into the box, for example, it stays there, the result stays empty and the note says: "This text is very long (550,000 characters). Split it into smaller parts for faster results."

Removing repeats is quick. In our tests it took 44 milliseconds or less to remove the repeated lines from 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with capital letters and the spaces at the ends of lines ignored and empty lines removed. The slow part is the browser showing a very long text in a box, so a result of more than 100,000 characters shows only its first 100,000, without cutting an emoji in half, and the note says so, for example "Showing the first 100,000 of 164,999 characters. Copy and Download take all of it." Copy and Download always take the whole result.

Tips

  • One item to a line. If your items are separated by commas, put each on its own line first with Find and Replace, replacing each comma and space with \n.
  • Tidy before you compare. Remove Extra Spaces makes spaces inside lines the same, so two copies of a name with different spacing count as one.
  • Turn on Ignore capital letters for names, words and emails; leave it off for codes.
  • Put the best copy first if the copies differ in capitals or spaces, because the first one stays.
  • Sort afterwards with Sort Lines if you want the cleaned list in alphabetical order.
  • Keep your own copy. The page forgets everything when you close it.

Limits

  • Whole lines only. It removes repeated lines, not repeated words inside a line or repeated sentences inside a paragraph.
  • Characters, not meanings. Different spellings or formats of the same thing are different lines.
  • Spaces inside a line count. Tidy them first if they differ.
  • No columns. For a table, it compares whole rows; to remove rows with the same value in one column, use a spreadsheet.
  • 500,000 characters at once, about 500 KB of English text.
  • Text only. It doesn't open Word, PDF or spreadsheet files: copy their text first.

Terms explained

Duplicate
A line that has already appeared earlier in the text.
First copy
The earliest line of a group of lines that count as the same. It is the one that stays.
Case
Whether a letter is a capital or small. Ignoring case makes Apple and apple the same.
Trailing space
A space at the end of a line, often invisible on screen.
Empty line
A line with nothing in it, or only spaces and tabs.

Frequently asked questions

How do I remove duplicate lines from a list?

Paste the list into the top box, one item on each line. The repeated lines are taken out at once, and the first copy of each stays. Copy the result, or download it as a text file.

Does it change the order of my lines?

No. The lines that stay keep the order they had; only the later copies are taken out. To sort the result, put it into Sort Lines.

Which copy is kept?

The first one, exactly as it was written, with its own capital letters and spaces. Later lines that count as the same are taken out.

Are Apple and apple the same?

Only with Ignore capital letters ticked. It is off at first, so lines that differ in capitals stay. Tick it for names, words and email addresses.

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

Ignore spaces at the ends is on at first, so apple and apple count as the same line. Spaces inside a line always count: tidy them first with Remove Extra Spaces.

What happens to empty lines?

With Remove empty lines too ticked, as it is at first, they all go. Untick it and every empty line stays where it was; empty lines are never counted as repeats.

How do I merge two lists without repeats?

Paste the first list, then the second one below it. The repeats go, and the lines of the first list come first.

How many repeats were removed?

The line under the result says, for example, "3 repeated lines removed; the first of each is kept." When there are none, it says "No repeated lines."

Can it remove repeated words inside a line?

No. It works on whole lines. A word repeated inside a sentence is left as it is.

Does it work for Hindi and other scripts?

Yes. Lines in Hindi, Tamil and every other script are compared character by character, the same as English.

Is Remove Duplicate Lines free?

Yes. There is no sign-up and no watermark, and you can use it as often as you like. Ads from Google help pay for the site. They are kept apart from the tool, and our code never gives them your text.

Is my text uploaded anywhere?

No. The tool has no upload step: it works inside your browser and never sends the text you type, paste or open anywhere, and it keeps no copy of it. Google's ad code is on the page, and our code never gives it your text. How we prove it shows how to check.

How much text can it take at once?

Up to 500,000 characters, about 500 KB of English text. A paste or a file that would go over is not added, and the page says so. In our tests it took 44 milliseconds or less to remove the repeated lines from 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with capital letters and the spaces at the ends of lines ignored and empty lines removed. See Long texts.

Can I open a text file, or a Word or PDF file?

A text file, yes: choose Open a text file or drop a .txt, .csv or similar file on the page, with up to 500,000 characters. A Word or PDF file must have its text copied out first, because the tool reads text, not those files.

Does it work offline?

Yes, once the page has loaded. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs. If you open the page for the first time with no internet, it can't load.

By the PDFGuild team · Updated · How we test