You run a list through a duplicate remover, it reports a satisfying number of duplicates removed, and then you spot it: the same entry twice, a few lines apart, wearing slightly different clothes. One has a capital letter the other lacks. One ends with a full stop. One says the same thing with the words in the other order. The tool was not lazy and it did not miss them. It was never looking for them, because they are not duplicates in the only sense a line tool understands.

This guide draws that line: what counts as an exact duplicate in the free Remove Duplicate Lines tool on Ovatly, which pairs slip past as near duplicates, and the two-pass routine that catches both kinds.

Contents

  • Quick answer
  • What exact means for a line tool
  • The near duplicates that survive
  • How to remove exact duplicates, step by step
  • Worked example: a five-line list, then the pairs that stay
  • The finishing pass: sort, then read
  • Limitations and honest notes
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

An exact duplicate is a line that matches an earlier line character for character once the tool's two rules have been applied: the rule that decides whether Apple and apple count as the same line, and the rule that decides whether surrounding spaces are ignored, which is on by default. Exact duplicates are removed, and the first occurrence wins, keeping its exact spelling. A near duplicate is anything a person would call the same entry that still differs inside the line itself: an extra word, different punctuation, words in a different order, a singular next to a plural. Near duplicates survive deduplication, so finish by sorting the result, which parks look-alike lines next to each other, and deleting the spare copies by eye.

What exact means for a line tool

The comparison the tool makes is deliberately simple. It reads your list one line at a time, where a line is anything between two line breaks, and asks of each line one question: has this line, under the current rules, already appeared? If yes, it is dropped. If no, it is kept and remembered. The first occurrence wins: its exact spelling and capitalization are what you see in the result, and every later repeat is removed. The tool reports how many duplicates were removed above the result.

Two rules adjust what counts as the same line. The first is the case rule: you decide whether Apple and apple are one line or two. The second is the spaces rule: with trimming on, which is the default, lines that differ only in leading or trailing spaces count as duplicates, so a line pasted with two stray spaces at the end still matches its clean twin. That is the whole definition; the comparison never looks at what a line means. Blank lines are treated as lines too, so a run of blank lines collapses to a single blank line.

The near duplicates that survive

A near duplicate fails the comparison by a small, real difference inside the line. Four families cover almost everything you will meet:

  • Extra words. "Green apples" and "apples" are different lines, even when both came from the same original entry.
  • Punctuation. A trailing full stop, a comma in a different place, or brackets around one version make the lines differ. The spaces rule only forgives spaces at the edges, never punctuation anywhere.
  • Word order. "Apples, green" and "green apples" hold the same words in a different order. To the tool they are unrelated lines; to you they are one entry written twice.
  • Singular and plural. "Apple" and "apples" differ by one letter, which is enough. Neither the case rule nor the spaces rule bridges that gap.

How to remove exact duplicates, step by step

  1. Open Remove Duplicate Lines and paste your list, one item per line.
  2. Decide the rules before you run it: whether Apple and apple count as the same line, and whether surrounding spaces are ignored. Leave trimming on unless you have a specific reason not to.
  3. Read how many duplicates were removed above the result: that number covers exact duplicates only.
  4. Copy or download the unique lines, and keep this output as the input for the finishing pass below.

Worked example: a five-line list, then the pairs that stay

The tool's own documented example is a five-line list:

apple
banana
apple
Cherry
banana

With the default settings, the result is:

apple
banana
Cherry

The report reads "2 duplicates removed out of 5 lines": the second apple and the second banana were exact duplicates, and the first occurrence of each survived with its spelling untouched, which is why Cherry keeps its capital C. Nothing was sorted.

Now add two lines a real list might easily contain, "apples" and "green apple". Both survive, sitting in the output alongside apple. They are not faults in the tool: one differs by a letter, the other by a whole word, and under the rules both are lines that have not appeared before.

The finishing pass: sort, then read

Near duplicates hide because they sit far apart. Sorting fixes the geography: run the deduplicated result through the Sort Lines Tool, and lines that begin the same way land next to each other, so "apple", "apples" and their cousins form a small block you can scan quickly. The Remove Duplicate Lines tool does not sort, and that separation is deliberate: deduplication keeps your original order, sorting replaces it, and many jobs want one without the other.

Read the sorted blocks and delete the spare copies by hand, deciding entry by entry which spelling should survive. Work on a copy if the original order matters, because sorting is not reversible. When the review is done, the list holds each entry once in both senses.

Limitations and honest notes

The tool works line by line only. Sentences inside one line are not compared with each other, so a paragraph with a repeated sentence passes through unchanged; split text into one item per line first. There is no fuzzy matching of any kind, and no setting that turns near duplicates into exact ones: the two rules adjust case and edge spaces, nothing else. The tool also keeps the first occurrence rather than the best one, so if the first copy of an entry is the misspelled one, the misspelling is what survives until you fix it by hand. On size: lists of hundreds of thousands of lines are handled comfortably because the check runs locally on your device, and your list is not uploaded.

Common mistakes

  • Trusting the removed count as a cleanliness score. It counts exact duplicates only. A list can report fifty removed and still hold a dozen near duplicates.
  • Running the tool with the case rule unsettled. Decide first whether capitals matter for this list; the wrong choice either merges entries you wanted separate or leaves pairs you expected to merge.
  • Turning trimming off without a reason. Most looks-identical-but-survived mysteries are edge spaces, and trimming exists precisely to forgive them.
  • Reviewing for near duplicates before deduplicating. Exact repeats make the review longer and noisier. Deduplicate first, sort second, read third.

FAQs

What is the difference between an exact duplicate and a near duplicate? An exact duplicate is a line that matches an earlier line once the tool's two rules are applied, so it is removed. A near duplicate is a line a person would read as the same entry, but which differs in some character the rules do not forgive, such as an extra word or a full stop. It stays in the result.

Does capitalization create a near duplicate? Only if the case rule is set to treat capital and lowercase letters as different. With the rule set so Apple and apple count as the same line, the second one is removed as an exact duplicate and the first spelling is kept.

Why did two lines that look identical both survive? They differ in something you cannot see, most often leading or trailing spaces. Trimming is on by default and ignores surrounding spaces, so check that it has not been turned off. If trimming is on and both lines still survive, the difference is a real character inside the line.

Can the tool catch singular and plural versions of the same entry? No. A line ending in s and the same line without it are different lines, so both survive. Catching that kind of pair takes a sorted list and a human read-through.

Can it find repeated sentences inside a paragraph? No. The tool works line by line, and sentences inside one line are not compared with each other. Split the paragraph into one sentence per line first if you need that check.

Conclusion

Exact and near duplicates are two different problems sharing one list. The Remove Duplicate Lines tool settles the first completely: set the case and spaces rules, and every line that matches an earlier one under those rules is gone, with the first spelling kept. The second problem is judgement work, and the honest tool for it is a sorted list and your own eyes. Do both passes and the list is genuinely clean. The wider set of list and text utilities lives in the Text and Writing Tools archive.

Related guide: How to Merge Two Lists and Keep Only Unique Entries.