Boneyard Tools

Compare Two Lists

Drop two lists into the List A and List B boxes, one item per line, and instantly see four groups: what is only in A, only in B, shared by both, and the combined union. Each group shows a live count and a copy button, so you can lift a slice straight into a spreadsheet or script. Matching updates as you type, and duplicates and blank lines are cleaned up before the compare.

How to compare two lists

  1. Paste your first list into the List A box, one item per line.
  2. Paste your second list into the List B box.
  3. Tick 'Ignore case' if 'Apple' and 'apple' should count as the same item.
  4. Leave 'Trim each line' on to drop leading and trailing spaces before matching.
  5. Read the four result groups and use the copy button on any of them.

Examples

Find shared and unique items

List A: apple, banana, cherry (one per line)
List B: banana, cherry, date (one per line)
Only in A (1): apple. Only in B (1): date. In both (2): banana, cherry. Union (4): apple, banana, cherry, date.

Match while ignoring case

List A: Apple, apple, Banana
List B: APPLE, cherry, with 'Ignore case' on
Only in A (1): Banana. Only in B (1): cherry. In both (1): Apple. Union (3): Apple, Banana, cherry.

Collapse duplicates within a list

List A: red, red, green, blue
List B: green, yellow
Only in A (2): red, blue. Only in B (1): yellow. In both (1): green. Union (4): red, green, blue, yellow.

Frequently asked questions

How are items separated?

By line. Put one item per line in each box. Blank lines are ignored, and surrounding whitespace is trimmed by default so a stray space does not make two otherwise identical items look different.

Can I match while ignoring case?

Yes. Tick 'Ignore case' so 'Apple' and 'apple' count as the same item. The result keeps the original casing from the first time an item appears, so the output stays readable.

What happens to duplicate items in one list?

Duplicates within a single list are collapsed to one entry before comparing, and the first occurrence wins. That means each item is counted once and the counts shown next to each group reflect distinct items.

What does the union show?

The union is every distinct item across both lists combined. It lists List A's items first, in their original order, followed by any items that appear only in List B.

Is the original order preserved?

Yes. Items keep the order they first appear in. 'Only in A' and 'In both' follow List A's order, 'Only in B' follows List B's order, and the union chains A then B's new items.

What is the difference between 'In both' and an intersection?

They are the same thing. 'In both' is the set intersection, the items that appear in List A and also in List B, and 'Only in A' plus 'Only in B' is the symmetric difference.

Can I compare thousands of lines?

Yes. The compare runs in your browser using hash sets, so even large lists resolve quickly. The practical ceiling is your device memory rather than a fixed row limit.

Is there an API?

Yes. This tool exposes a JSON endpoint that accepts listA and listB strings plus optional caseInsensitive and trim flags, and returns onlyA, onlyB, both, and union arrays.

Is my data private?

Yes when you use the tool in the browser. The comparison happens locally and nothing is uploaded, so pasted lists never leave your device.

Learn more

Related tools