Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Writing tools

Remove duplicate lines

Paste a list, one item per line, and get every line once, in the order it first appeared. Nothing you paste leaves your device.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Show
Options
Result
apple banana cherry date
  • 2 duplicate lines removed
Lines
6 before, 4 after
Characters
37 before, 24 after
Repeated lines found
2

How to use the Remove Duplicate Lines

  1. Paste your list into Your lines, one item per line.
  2. Under Show, keep Each line once, or choose to see only the repeated lines or only the lines that never repeat.
  3. Turn on Ignore case, Ignore spaces at the ends or Remove blank lines if your list needs it.
  4. Check the line counts under Result, then press Copy.

How do I remove duplicate lines from a list?

Paste the list into the box. The tool reads it line by line and keeps the first time each line appears. Later copies are dropped, and the lines that remain stay in their original order. A list of apple, banana, apple, cherry, banana, date (one per line) becomes apple, banana, cherry, date: six lines in, four out, two removed.

The counts under the result show lines and characters before and after, and how many different lines were repeated. If the "lines after" number is not what you expected, look at the options: two lines only count as the same when they match exactly, character for character, unless you tell the tool to be more relaxed.

Can it ignore case or trailing spaces?

Yes. By default the comparison is exact, so "Apple" and "apple" are two different lines, and so are "apple" and "apple " with a space at the end. That default is right for code, IDs and file names, where a capital letter or a space really changes the meaning.

For names, emails and keywords copied from different places, turn on Ignore case so "Apple", "apple" and "APPLE" count as one line. The first version that appeared is the one you keep. Turn on Ignore spaces at the ends to compare lines without leading and trailing spaces or tabs; the spaces are also removed from the lines you get back, so the list comes out clean. Remove blank lines deletes empty lines before comparing. Without it, a blank line is treated like any other line, so only the first blank line survives.

How do I show only the duplicated lines?

The Show setting has three views. Each line once is the usual clean-up. Only repeated lines lists each line that appears more than once, one time each, which is the quickest way to see what is duplicated in a long list. Only lines that never repeat drops every line that has a twin, including the first copy, and keeps the lines that appear exactly once.

The tool works on very long lists, but a paste of several million characters can make a browser tab slow, so above five million characters it asks you to split the text. Windows line endings (CRLF) are kept as they are in the result. If your data is in a spreadsheet, the same idea works there too: Excel and Google Sheets both have a "remove duplicates" command for a column. Copy the column here when you only need a quick pass on plain text.

Use it with

Questions

Does it keep the original order?

Yes. Each line is kept at the position where it first appeared, and later copies are removed. Nothing is sorted.

Can it ignore capital letters?

Yes, turn on Ignore case. "Apple", "apple" and "APPLE" then count as one line, and the first one you typed is kept.

How do I show only the duplicated lines?

Choose Only repeated lines under Show. Each line that appears more than once is listed a single time.

Why was a line with an extra space kept?

The default comparison is exact, so "apple" and "apple " differ. Turn on Ignore spaces at the ends to treat them as the same line.

Is my list uploaded anywhere?

No. The lines are compared in your browser, so the text never leaves your device.

How this page was made: the tool's results are computed in your browser by the code on this page; the explanations were drafted with AI help and checked against the tool's own output.