List Compare Tool (Common & Unique Lines)

Compare two text lists (one item per line) and instantly extract the lines common to both, the lines only in A, and the lines only in B using set operations. Useful for matching mailing lists or checking inventory duplicates. Everything runs in your browser — nothing is sent to a server.

Tips

  • Compare your mailing list against an unsubscribe list to instantly extract the addresses you should exclude from your next send.
  • Compare an inventory list against a purchase-order list to quickly find out which items haven't been ordered yet.
  • Leading and trailing whitespace on each line is trimmed automatically, so stray spaces from copy-pasting won't affect the comparison.
  • Even if a line appears multiple times in your input, the result shows each unique line only once, making it handy for cleaning up messy lists.
  • Uncheck "Case-sensitive comparison" to treat inconsistent capitalization (like Example.com and example.com) as the same line.

Frequently Asked Questions

The diff tool aligns two texts line by line while preserving their order, and detects added or removed lines. This tool ignores order entirely and treats each list as a set, extracting common lines and lines unique to each side. If the same line appears in a different position, the diff tool reports it as a change, while this tool treats it as common.

Even if the same line appears multiple times in your input, it is shown only once in the result as a unique line. This tool does not compare occurrence counts.

By default, comparison is case-sensitive. Uncheck "Case-sensitive comparison" to treat differences like Example and example as the same line.

Leading and trailing whitespace is stripped automatically, and lines that become empty as a result are excluded from the comparison. You can paste lists without worrying about stray blank lines.

No. All comparison happens entirely in your browser's JavaScript, and the content of your lists is never sent to a server — even lists containing personal information like email addresses are safe to use here.
ツールくん

Side Note — Comparing lists with set operations

There's more than one way to find the "difference" between two lists. Line-based diff algorithms, like the ones used in the text diff tool, preserve order while searching for correspondences between lines — which makes them ideal for tracking changes in source code or config files. But for lists where order carries no meaning, like email addresses or inventory codes, thinking in terms of set operations (intersection and difference) is far more intuitive. This tool takes the latter approach.

In set theory, the "intersection" is the set of elements common to both sets, while the "difference" is the set of elements found in only one. In this tool, "common lines" corresponds to the intersection (A∩B), while "only in A" and "only in B" correspond to the differences (A−B and B−A) respectively. It's a simple mathematical operation, but it shows up constantly in practical work — deduplicating customer lists, narrowing down mailing targets, and more.

Under the hood, this tool compares lines using a JavaScript Map, keyed by a normalized version of each line (unchanged when case-sensitive, lowercased otherwise), recording the first original spelling encountered for each key. This lets it compare lists with thousands of lines quickly while still preserving the original capitalization of each output line.