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.

What this list comparison tool does

Holding two lists side by side and working out which entries appear in both and which appear in only one is the kind of task the eye reliably gets wrong. Paste two blocks of text, one item per line, and this tool sorts them into three groups — shared lines, lines only in A, and lines only in B — using plain set operations. It is meant for the moments when you want to reconcile mailing addresses, stock lists or membership rosters without building a spreadsheet formula first.

Line order is ignored. Identical entries sitting at different positions still count as shared, so the two lists do not need to be sorted the same way. Leading and trailing spaces are stripped, blank lines are skipped, and duplicates collapse into a single entry. You can choose whether capitalisation matters; when it does not, matching ignores case while the lines shown on screen keep exactly the spelling you pasted. Everything runs in your browser, so nothing you paste is sent anywhere.

How to compare two lists

  1. Paste list A One item per line. A single column copied straight out of a spreadsheet pastes in cleanly.
  2. Paste list B The other list, in the same format. The two do not need to have the same number of lines.
  3. Decide how capitalisation is treated Turn case sensitivity off to absorb inconsistent spelling, as with email addresses. Leave it on when you need an exact match, as with IDs or product codes.
  4. Read the three results Shared, only-in-A and only-in-B appear together, each with its own copy button so you can pass the output straight to whatever comes next.

Tips for getting more out of it

  • 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.

Where this comparison helps

Reconciling a mailing list

Compare the addresses you have already contacted against the full list and pull out the ones still waiting. Turning case sensitivity off treats differently capitalised addresses as the same person.

Checking stock against a count

Put the product codes from your records beside the ones counted on the floor and see, in one pass, what is on the books but missing and what turned up unrecorded.

Finding who joined and who left

Compare last month's member IDs with this month's: only-in-A are the people who left, only-in-B the people who joined.

Comparing configuration keys

List the environment variable names from production and staging and spot the keys that exist in only one of them. Useful when you care about which keys exist rather than what they hold.

List comparison terms explained

Shared lines (intersection)
Entries that appear in both A and B — the intersection in set terms. Position does not matter; identical content anywhere in either list counts.
Only in A (difference)
Entries present in A but absent from B, which is A minus B as a set difference.
Set operation
Treating entries purely as present or absent, disregarding order and duplication. This is why the tool pays no attention to how the lists are sorted.
How this differs from a diff
A diff keeps line order and shows what was inserted or deleted, which means reordering alone shows up as a change. This tool ignores order, so matching content always counts as shared. Pick whichever matches your question.
Case sensitivity
With it switched off, comparison folds everything to lower case. The lines displayed keep the spelling you pasted, so the original capitalisation is never lost.

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.
Tool-kun

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.