Text Set Operations

Compare two line lists using intersection, union and differences. Choose whitespace and case rules, inspect the unique results, then copy or download locally.

One item per line. Up to 1,000,000 characters across both inputs. No upload or automatic saving.

What is Text Set Operations

Use line sets to compare inventories, identifiers or tags. Unlike a sorter or duplicate remover, this tool compares membership in two lists and returns one copy of each matching item. It does not align changed lines or compare the meaning of words.

How to use Text Set Operations

  1. Paste list A and list B, with one item per line.
  2. Select the operation and review trimming, case and empty-item options.
  3. Calculate, check the item count, then copy or download. Editing either input or an option clears the old result.

Features and limits

  • The first spelling encountered is retained. Intersection and A-only follow A order; B-only follows B order. Union and symmetric difference list A items before new B items.
  • LF, CRLF and CR line endings are accepted. One trailing line terminator is ignored. Empty input is an empty set; an interior blank line can represent an empty item when skipping is disabled.
  • Case-insensitive comparison uses JavaScript lowercase conversion, not locale-aware collation or Unicode normalization. The limit is 1,000,000 JavaScript string code units across both inputs.

This tool processes your input in this browser and does not upload it for processing.

Worked example
A: apple, pear, apple
B: pear, plum
A ∩ B: pear
A ∪ B: apple, pear, plum
A − B: apple
B − A: plum

Frequently asked questions

Are duplicates counted?

No. This is set membership, not a frequency comparison. Repeated items appear once.

Does trimming modify the output?

Yes. With trimming enabled, leading and trailing whitespace is removed from both comparison keys and displayed values. Case-insensitive matching keeps the first encountered spelling.

How do I find items missing from B?

Choose Only in A (A − B). For A containing apple and pear and B containing pear and plum, the result is apple.

Related tools

Sources