Compare two lists: only in A, only in B, in both

Paste two lists and see what is unique to each and what they share. Nothing leaves your browser.

How it works

  1. Paste List A and List B
  2. Choose how items are matched
  3. Copy any of the three results

Set comparison, not a line-by-line diff

This page treats each list as a set of items. It answers three questions: which items are only in List A, which are only in List B, and which are in both. Order does not matter and position does not matter. If you want to see which lines changed between two versions of a text, in order, use the text diff tool instead. Here, a list of names pasted in a different order gives the same three results. Each result has its own box and its own copy button.

What counts as the same item

Two lines are the same item when they are the same text. By default the match ignores letter case, so Banana and banana match, and it ignores spaces and tabs at the start and end of a line, so cherry and cherry with spaces after it match. Turn Case sensitive on and they differ. Ignoring case compares the lower-cased text (with the Greek final sigma ς treated as σ), not full Unicode case folding. Turn the spaces option off and a padded line differs from a clean one. Spaces inside a line always count, and accents count: cafe and café are different items. In the In both box the spelling from List A is shown.

Repeats and blank lines

A repeated item inside one list counts once. If apple appears twice in List A, it is one item, and the result shows it once. The counts under the result, Items in A and Items in B, are counts of distinct items, not of lines. Blank lines, including lines with only spaces, are not items and are ignored. The page says this under the results so the counts are not a surprise. For every list the first spelling is the one kept.

Order, sorting and limits

Without sorting, each result follows the order of its list, with In both following List A. Sort the results A to Z puts all three boxes in alphabetical order; with case sensitivity off, upper and lower case sort together. Windows, old Mac and Unix line endings are read as one break each. The work happens in your browser, in this tab. No server receives your lists, and they are not saved or put in the page address. Only your three choices are remembered in this browser. Each list can hold up to 1,000,000 characters.

Frequently asked questions

Does the order of the lists matter?

Only for which side is called A. Swapping the two lists swaps the Only in A and Only in B boxes, and In both holds the same items. The order of lines inside each list does not change which items match.

If an item appears twice in one list, is it counted twice?

No. Each list counts a repeated item once. If a name appears three times in List A and once in List B, it is one shared item. The page notes this under the results.

Why do cafe and café not match?

Accents count as part of the text. The tool only ignores letter case and spaces at the ends of lines, and only when you leave those options on. Retype one of them so both lists use the same spelling.

How is this different from the text diff tool?

The text diff tool compares two versions of a text line by line and shows what was added, removed or moved. This page compares two lists as sets, ignoring order, and gives you three lists: only in A, only in B and in both.

Are my lists uploaded?

No. Both lists are processed in your browser, in this tab, and no server receives them. Your choices are saved in this browser, but the lists are not, so closing the tab clears them.