Clever Quest Lab Tools

List Compare

2026-10-06

Paste two lists and see at once which items appear in both, which only in the first, which only in the second, plus the merged list and the duplicates inside each list. Works for e-mail addresses, IDs, product codes and names, and everything stays in your browser.

Your two lists

0 items

0 items

Options

Blank items are always ignored.

Results

In both lists

0

Intersection, A ∩ B

In either list, merged

0

Union without duplicates, A ∪ B

Only in A

0

Difference, A − B

Only in B

0

Difference, B − A

In one list but not both

0

Symmetric difference

Duplicates inside A

0

Items listed more than once, with their count

Duplicates inside B

0

Items listed more than once, with their count

Your lists are processed in your browser and never uploaded. Small lists (under about 100 KB together) and your options are remembered on this device; larger lists are not saved.

How to use the list compare tool

  1. Paste or type your first list into List A and your second list into List B. The default is one item per line. If your items sit on one line, pick comma, semicolon or tab under “Items are separated by”.
  2. Choose the options. Ignoring case and trimming spaces are on by default, because they remove the most common false differences. You can keep the original order or sort the results A–Z.
  3. Read the seven result boxes. They update a moment after you stop typing, and each box shows how many items it holds.
  4. Press Copy under a box to copy its items, one per line, or Download results (.txt) to save all of them in one file.
  5. Use Swap A ↔ B to exchange the lists, Load sample data to see an example, or Clear both to start again.

What each result means

The results come from basic set operations. A short example makes them clear. Let List A be apple, Banana, cherry, cherry, date and List B be banana, Cherry, elderberry, fig, with case ignored.

ResultSet nameItems
In both listsIntersectionBanana, cherry (2)
Only in ADifference A − Bapple, date (2)
Only in BDifference B − Aelderberry, fig (2)
In either list, mergedUnion6 distinct items
In one list but not bothSymmetric differenceapple, date, elderberry, fig (4)
Duplicates inside ARepeated itemscherry (×2)

The intersection holds what the two lists share. A difference holds what one list has and the other lacks, so it depends on the direction. The union is everything from both lists with every item written once. The symmetric difference is the union minus the intersection: everything that belongs to exactly one list. A result never contains the same item twice, and when case is ignored the first spelling the tool saw is the one shown. The duplicate boxes list items that occur more than once inside a single list, each once, with the number of occurrences.

How it works

Each piece of text is split at the separator you chose. Every item is then cleaned: spaces at both ends are removed if trimming is on, and the text is converted to lower case to build a comparison key if case is ignored. Empty items are dropped. Each list is stored in a Map, a lookup table from key to the first spelling and the number of times the key appeared. Finding the intersection means looking up each key of A in the table of B, and a lookup takes about the same time however long the list is. The work therefore grows in proportion to the number of items instead of with the square of it, which is why lists of 50,000 lines each can be compared without freezing the page.

The tool compares text, not meaning. Two items are equal only when their cleaned characters are identical. With sorting on, items are ordered with the browser’s language-aware rules, ignoring case, so the order of accented letters can vary slightly with your language settings.

Examples

Example 1 — case ignored. The fruit lists above give two items in both, two only in A, two only in B, six in the union and four in the symmetric difference.

Example 2 — case respected. Untick “Ignore upper/lower case” with the same lists. Banana and banana are now different items, as are cherry and Cherry. Nothing is in both lists, four items are only in A, four only in B, and the union has eight items.

Example 3 — e-mail addresses. Choose the semicolon separator. List A is ann@example.com; Bob@example.com; cara@example.com and List B is bob@example.com; dan@example.com; Ann@example.com. With case ignored, ann@example.com and Bob@example.com are in both lists (shown as spelled in A), cara@example.com is only in A, and dan@example.com is only in B. The union has four addresses.

Example 4 — leading zeros. List A is the three lines 007, 12, 5 and List B is 7, 12, 5. Items 12 and 5 are in both lists. 007 is only in A and 7 is only in B, because the text differs even though the numbers are equal.

Typical uses

Common pitfalls

List compare versus a text diff tool

A text diff tool compares two versions of a document line by line and in order. It shows what was inserted, deleted or moved at each position, which is ideal for revisions of a file. List Compare ignores order and position completely. It treats each list as a collection and asks which items belong to which collection. Two lists that hold the same items in a different order are identical here. Choose a diff tool to review edits to one text, and List Compare to check membership between two lists.

Frequently asked questions

Are blank lines and repeated items a problem?

No. Blank and whitespace-only items are always ignored. Repeated items are counted for the summary and the duplicate boxes, but each item appears only once in the other results.

Which spelling is shown when case is ignored?

The first spelling seen. Items found in A show A’s spelling, even if B writes them differently. Items found only in B show B’s spelling.

How large can the lists be?

There is no fixed limit. Lists of 50,000 lines each are compared in a moment.

Can I compare more than two lists?

Not in one step. Compare A with B, copy a result such as the union or the intersection into List A, paste the third list into List B, and compare again.

Are my lists uploaded anywhere?

No. The comparison runs in your browser and nothing is sent to a server. Options, and lists under about 100 KB together, are saved in your browser’s local storage so they are still there when you return. Clear both removes them.

Related tools