How to Compare Two Lists and Find What Is in Both, Only in A, or Only in B
Compare two lists to find the intersection, items only in A, and items only in B. A practical guide to list comparison for reconciling exports and finding missing items.
How to Compare Two Lists and Find What Is in Both, Only in A, or Only in B
I keep two lists open on my screen more often than I would like to admit. An export from the old system and an export from the new one. Yesterday's column of order IDs and today's. Who has access to a database versus who is supposed to. Every time, the question is the same: what overlaps, what dropped out, and what is new? Eyeballing two columns and dragging a finger down the screen is slow and wrong by line 40. The clean way to answer it is set comparison, and it is exactly what our list comparison tool does: paste two lists and it shows the intersection (in both), items only in A, and items only in B. That is set difference, and it is perfect for reconciling two exports or finding what is missing.
The three answers you actually want
When you put two lists side by side, almost every real question reduces to three groups.
- In both — the intersection. The items that appear on list A and list B. These are the records that carried over, the people on both rosters, the SKUs that survived.
- Only in A — the set difference A minus B. Every item in A whose value never appears anywhere in B. This is what you added, what the other side is missing, or what you removed depending on which list you call A.
- Only in B — the mirror image, B minus A. What the other list has that yours does not.
A fourth bucket, the merged duplicate-free union, is handy when you want one clean combined list with nothing repeated. But the three above are the workhorses. Once you see your data sorted into them, the answer to "what is going on between these two lists" is usually obvious in a second.
Set comparison is not a text diff
This trips people up, so it is worth being blunt about. A text diff compares two blocks line by line in order and highlights inserts, deletes and edits where they sit. Move one line and a diff calls it a change. List comparison treats each list as a set: order is ignored, and the same value appearing twice still counts once.
Take list A as apple, banana, cherry and list B as cherry, apple, banana. A diff tool paints a wall of red and green because the lines moved. Set comparison says zero differences — both lists hold the same three items. Use a diff to review edits inside one document. Use list comparison to compare two membership lists where position carries no meaning.
A worked example: which emails are only in one list
Here is the kind of job I run constantly. Marketing handed me a CSV of newsletter subscribers, and support handed me a separate list of people who opened a ticket this quarter. The question: who subscribed but never contacted us, and who contacted us without subscribing?
List A (subscribers):
anna@example.com
bob@example.com
cara@example.com
dan@example.com
List B (ticket openers):
bob@example.com
cara@example.com
erin@example.com
Paste A on the left, B on the right, and the panels split cleanly:
- In both:
bob@example.com,cara@example.com— two people who both subscribed and opened a ticket. - Only in A:
anna@example.com,dan@example.com— subscribers we have never heard from in support. - Only in B:
erin@example.com— someone who needed help but is not on the newsletter, an obvious candidate to invite.
That is set difference doing the work. Copy "Only in B" straight into an email and you have your re-engagement list in under ten seconds. The same shape works for user IDs, SKUs, account numbers, or any one-item-per-line list.
Case sensitivity is the quiet trap
The single most common way list comparison goes wrong is capitalization. If one export wrote Alice@x.com and the other wrote alice@x.com, a strict comparison sees two different strings. They split across "Only in A" and "Only in B" and never meet in the intersection, which quietly understates your real overlap.
Turn on Ignore case and those two collapse into one item that lands in "In both." The panels still display the original text you pasted — the change is only in how two lines are matched. Leave it off when case genuinely carries meaning: case-sensitive passwords, file paths on Linux, or programming identifiers where Total and total are different things.
Trailing whitespace is the same trap wearing a different coat. A line ending in a space does not match the same word without one. For anything you copy-pasted out of a spreadsheet or terminal, keep Trim on so a stray space does not manufacture phantom differences.
Common jobs this solves
A few patterns I reach for again and again:
- Reconciling two exports. Old CRM versus new CRM. "Only in A" is everyone the migration dropped — re-import them. "Merged" seeds a clean combined list with no duplicates.
- Finding missing items. Compare a column of expected IDs against what actually shipped; "Only in A" is the gap, no VLOOKUP and no formula required.
- Auditing access. Who currently has access versus who is approved. "Only in A" is people with access who should not have it; "Only in B" is approved people still waiting. A tedious eyeball check becomes a copyable report you can drop into a ticket.
- Dedup across lists. Two overlapping lists you want to fold into one. The merged union strips every duplicate across both.
If your real problem is deduplicating within a single list rather than comparing two, the dedicated text deduplicator is the cleaner fit — it collapses repeated lines in one block with the same ignore-case and trim controls.
Everything stays in your browser
One detail that matters when the lists are customer emails or internal user IDs: both lists are compared by plain JavaScript running inside your browser tab. Nothing you paste is uploaded, logged, or sent anywhere. That makes it safe for sensitive rosters where shipping the data to some server's API would be a non-starter.
The one caveat worth knowing: the shareable link encodes both lists in the URL so a recipient can reopen them. That is convenient for "look at this comparison" but it means a link pasted into a chat tool records that data in the other server's logs. For confidential lists, use the copy buttons and paste the results instead of sharing the URL.
That is the whole idea. Two lists in, three honest answers out — what is shared, what is yours alone, and what is theirs — computed locally and ready to copy.
Made by Toolora · Updated 2026-06-13