List Comparison & Set Operations
Find items in both lists, in one only, or combined — union, intersection and difference.
Comparing two lists means answering four questions: what is in both, what is only in the first, what is only in the second, and what does the combined set look like. Paste one item per line and get all four at once, plus counts of duplicates within each list.
Runs in your browser- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
The four questions a list comparison answers
Comparing two lists is set arithmetic wearing plain clothes. Whatever the task is called in the office, it resolves to one of five operations, and the default view runs four of them at once so you do not have to decide up front which one you needed.
| What you want to know | Set operation | What comes back |
|---|---|---|
| What is in both lists | Intersection | Every item present in the first list and also in the second. |
| What is only in the first | Difference | Items in the first list with no match in the second. |
| What is only in the second | Difference, reversed | The mirror of the row above. |
| What is in one list but not both | Symmetric difference | The two difference sets joined: everything that failed to match. |
| Everything, once each | Union | Both lists merged with repeats collapsed. |
The settings that change the answer
- Case sensitivity is off by default, so
Aliceandalicecount as one item. Turn it on for identifiers, tokens and paths on a case-sensitive filesystem, where the difference is real. - Whitespace is trimmed by default. A trailing space is the single most common reason two lists that look identical share nothing at all: it survives a copy out of a spreadsheet cell and it is invisible on screen.
- Repeats inside one list are collapsed in the results but counted separately in the summary, so you can see that the first list had 412 rows and 398 distinct values without leaving the page.
- Sorting applies to the output only, using a numeric-aware comparison, so
item2lands beforeitem10instead of after it. - Blank lines are dropped, which means a trailing newline at the end of a paste does not turn into an empty item that matches nothing.
What people actually use it for
- Reconciling two exports: who is in the CRM but not on the mailing list, or which SKUs the supplier sent that the catalogue has never heard of.
- Seeing what a change touched: two lists of config keys, environment variables or file paths, before and after.
- Skipping work already done: put the processed identifiers in the second list and take only in the first.
- Measuring overlap before merging two audiences, tag sets or keyword lists, where the intersection count is the answer on its own.
If the input is messy, remove duplicate lines and sort each list first so the output is easier to read. And if you are comparing two versions of the same text rather than two sets of items, use the diff checker instead: a diff cares about order and position, and a set comparison deliberately does not.
Frequently asked questions
What is the difference between union and intersection?
Why does it report duplicates within a list separately?
How to use the list comparison & set operations
- 1Enter or paste your first list.
- 2Enter or paste your second list.
- 3Choose the show.
- 4Turn "Case sensitive" on or off as needed.
- 5Turn "Trim whitespace" on or off as needed.
- 6Turn "Sort results" on or off as needed.
- 7The result appears immediately — copy or download it.
Embed this tool
Put the working list comparison & set operations on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
Last updated
More text tools