Remove Duplicate Lines

Paste a list with repeats. Each line appears once in the result, in the order it first appeared, and the count of removed lines is shown below.

How it works

The tool reads your text line by line and remembers each line it has seen. When a line comes up again, it is left out. The lines that stay keep their order; nothing is sorted.

By default two lines must match exactly, spaces and capitals included. Ignore capitals treats "Apple" and "apple" as the same line. Trim spaces at the ends first takes spaces and tabs off both ends of every line before comparing, so "apple " and "apple" match too.

Keep the last picks the final copy of each repeated line instead of the first, and the kept lines appear where those last copies were. Everything runs on this page.

How to use it

  1. 1 Paste your list into the Text box.
  2. 2 Choose Keep the first or Keep the last.
  3. 3 Turn on Ignore capitals or Trim spaces at the ends first if near-matches should count as repeats.
  4. 4 Read the count below the result, then copy or download the clean list.

Good to know

  • Merging two email lists? Paste one under the other and turn on Ignore capitals, because addresses are not case-sensitive in practice.
  • Keep the last is the right choice for a log where a later line updates an earlier one.
  • If you also want the list in order, the Sort Lines tool can remove duplicates and sort in one step.
  • Blank lines count as lines, so a list with several gaps keeps only the first one. Remove Empty Lines can take them all out.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Merging two mailing lists without writing to anyone twice

Say you run a small club and have two sign-up lists: 140 addresses from a paper form typed up by a volunteer, and 210 from a web form. Many people signed up both ways. Paste the first list into the Text box and the second list straight under it, so you have 350 lines. The note under the result now tells you how many lines were repeats and how many are left.

On the first run the count may be lower than you expect. The usual reason is capitals. The volunteer typed "Maria.Lopez@example.com" and the web form stored "maria.lopez@example.com". Those are different lines to a computer, but the same inbox in practice, because mail providers treat the part before the @ without regard to case. Turn on Ignore capitals and run it again. The kept line is the first copy, written the way it first appeared.

The second usual reason is a space you cannot see. Text copied from a spreadsheet or a PDF often has a trailing space or a tab on some lines. Turn on Trim spaces at the ends first, and those lines match their clean twins. This switch also trims the lines in the result, so the clean list has no stray spaces left in it.

Keep the last is for lists where a later line is the better one. In an export where people updated their details, the last line for each person is the current one. With Keep the last, the tool keeps that copy and drops the earlier ones, and the kept lines stay in the order of their last appearance.

The tool has honest limits. It compares whole lines, so it cannot tell that "Maria Lopez, maria@example.com" and "maria@example.com" are the same person. It does not know that two different-looking addresses belong to one inbox, such as a Gmail address with and without a dot. Characters that look alike but are different, such as a Latin "a" and a Cyrillic "а", still count as different. It takes up to 1 MB of text at a time.

Frequently asked questions

Does removing duplicates change the order of my list?

No. The lines that stay are in the same order as before. Only the repeats are taken out.

What is the difference between keeping the first and keeping the last?

With a, b, a, c, keeping the first gives a, b, c. Keeping the last gives b, a, c, because the a that stays is the one after b.

Why are two lines that look the same not treated as duplicates?

One of them usually has a space or a tab at the end, which you cannot see. Turn on Trim spaces at the ends first. If they still do not match, one may contain a different character that looks the same, such as a no-break space.

Is my list sent anywhere?

No. The comparison runs in your browser, on this page.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.