Remove Duplicate Lines

Delete repeated lines.

Updated
Loading tool…

Delete repeated lines.

How to use Remove Duplicate Lines

  1. Paste your list of text into the box
  2. Toggle case-insensitive matching, whitespace trimming, or blank-line removal
  3. Copy the cleaned list keeping each line's first occurrence
Try next →HTML to TextStrip tags to plain text.

About Remove Duplicate Lines

Remove Duplicate Lines takes any list of text and deletes repeated lines, keeping only the first occurrence of each and leaving everything in its original order. Paste your list, and live counts show how many lines you started with, how many are unique, and how many were removed, so you can see the cleanup at a glance before you copy the result.

Three toggles handle the messy cases. Case-insensitive matching treats 'Apple' and 'apple' as the same line; 'trim each line' ignores leading and trailing spaces so entries that differ only by whitespace collapse together; and 'remove blank lines' strips empty rows out of the output entirely. That covers the usual reasons a plain sort-and-dedupe misses duplicates.

It is built for people who would rather not wrestle with Excel's Remove Duplicates dialog, a vim or awk one-liner, a bash 'sort -u', or a plugin for VS Code, Sublime Text, or Notepad++ just to clean a quick list. Anything you can paste into a browser works here, on any operating system. Note that this handles duplicate lines of text, not overlapping geometry in AutoCAD.

The tool is completely free with no sign-up, usage limits, or watermarks, and it runs entirely in your browser using plain JavaScript. Your text never leaves your device or gets uploaded to a server, so it is safe for private or sensitive lists.

Frequently asked questions

How do I remove duplicate lines online?
Paste your list into the box and the tool instantly deletes repeated lines, keeping the first occurrence of each. Toggle the options you need, then click Copy result to grab the cleaned-up text. Nothing is uploaded, so it works for any list you can paste.
Does it keep the original order of my lines?
Yes. The tool keeps the first occurrence of each line in its original position and only removes the later duplicates, so the order you pasted is preserved. It does not sort your list unless you want to sort it separately.
How do I remove duplicate lines in Excel?
In Excel you would put your list in one column, select it, and use Data then Remove Duplicates. If you just have a quick list to clean, it is often faster to paste it here, remove the duplicates, and paste the result back into your sheet.
How do I remove duplicate lines in vim?
In vim you can run :sort u to sort and drop duplicates, or use :%!awk '!seen[$0]++' to remove them while keeping order. If you would rather not type a command, paste the lines here and the ordered dedupe is done for you.
How do I remove duplicate lines in VS Code, Sublime Text, or Notepad++?
Those editors need an extension or a command such as VS Code's 'Delete Duplicate Lines' or Notepad++'s TextFX or 'Remove Consecutive Duplicate Lines'. This tool needs no plugin: paste your text, and it removes every duplicate line, not only adjacent ones, right in the browser.
How do I remove duplicate lines from a file in Linux or bash?
The common one-liners are sort -u file.txt, or awk '!seen[$0]++' file.txt to remove duplicates without reordering, and uniq for adjacent duplicates only. If you are not on the command line, paste the file's contents here to get the same ordered result.
What is the awk command to remove duplicate lines?
awk '!seen[$0]++' file.txt prints each line the first time it appears and skips later repeats, which keeps the original order. This tool does the same thing visually, plus optional case-insensitive matching and whitespace trimming that a plain awk command does not do by default.
Can this remove duplicate lines in AutoCAD?
No. AutoCAD's duplicate 'lines' are overlapping drawing geometry, which you clean up with its OVERKILL command. This tool only removes duplicate lines of text from a pasted list.
What does the case-insensitive option do?
When enabled, lines that differ only in letter case (for example 'Apple' and 'apple') are treated as duplicates, and only the first is kept. When off, case must match exactly for a line to count as a duplicate.
What do 'trim each line' and 'remove blank lines' do?
'Trim each line' removes leading and trailing spaces before comparing, so lines that differ only by whitespace are treated as identical. 'Remove blank lines' deletes empty lines entirely from the output.
Can I copy the cleaned-up result?
Yes. Once duplicates are removed, click the Copy result button to copy the unique lines to your clipboard. You will see a brief 'Copied!' confirmation.
Is this duplicate line remover free, and is my data private?
Yes on both counts. It is completely free with no sign-up, usage limits, or watermarks. All processing happens locally in your browser using JavaScript, so your text is never sent, stored, or uploaded, which makes it safe for sensitive or private lists.