OnlineTool.me

Compare Two Lists

Compare two newline-separated lists and switch between shared items, one-sided differences, and a combined unique set.

Text & List Tools
List A
List B
Result

What Is Compare Two Lists?

The Compare Two Lists tool treats each non-empty line as one item. It can show the intersection, entries found on only one side, or one combined list with exact duplicates removed.

Leading and trailing whitespace is removed before comparison. Matching is still case-sensitive and punctuation-sensitive, so small textual differences create separate items.

How to Use Compare Two Lists

1

Enter List A

Type or paste your first list into the left input box.

2

Enter List B

Type or paste your second list into the right input box.

3

Choose Comparison Mode

Select whether to find common items, differences, or unique items.

4

View Results

See the comparison results instantly, ready to copy or export.

How List Comparison Works

Each input is split at newline characters. Empty rows are removed and surrounding whitespace is trimmed before two Sets are created for membership checks.

Common Items filters List A for values found in List B. The one-sided modes filter against the opposite Set, while All Unique combines both lists and removes exact repeats.

Common items = List A ∩ List B

Example

If List A contains Apple and Pear while List B contains Pear and Plum, Common Items returns Pear, Only in A returns Apple, and Only in B returns Plum.

Compare Two Lists Features

  • Common Items, Only in A, Only in B, and All Unique modes
  • Updates the active result whenever either input changes
  • Preserves source order for one-sided comparisons
  • Copies the result as newline-separated text

Common Use Cases

Inventory comparison

Compare inventory codes, IDs, or exported records to identify entries present in one list but missing from another.

Roster or keyword review

Review overlap between rosters, keyword sets, labels, filenames, or other one-item-per-line data.

Limits and Important Notes

  • Comparison is case-sensitive: Apple and apple are different entries.
  • Duplicate common entries in List A can appear more than once in Common Items.
  • Only newline-separated input is supported.

Frequently Asked Questions