How to Use the List Operations
- Paste List A in the left panel and List B in the right panel — one item per line.
- Click Union, Intersection, A − B or B − A.
- The result appears in the bottom panel with a live item count.
- Use Copy to take the result to your next step.
List Operations treats each input panel as a set: lines are trimmed, blanks dropped, and the remainder loaded into a JavaScript Set. The four buttons then run union (every distinct item from either list), intersection (items in both), A − B (items in A but not B) and B − A (items in B but not A). The result panel shows a live count.
How the List Operations Works
Comparison is strict string equality, so 'apple' and 'Apple' stay distinct — pre-lowercase your lists with a text-case tool if you need fuzzy matching. To compute the symmetric difference (items in exactly one list), run A − B and B − A and concatenate. Everything happens locally; nothing about the lists leaves the browser.
- A ∪ B, A ∩ B, A − B and B − A — every common pairwise set op
- Trims and drops blank lines automatically
- JavaScript Set semantics — exact-match deduplication
- Case-sensitive — pre-lowercase your lists if you need fuzzy matching
Frequently Asked Questions
How is a 'set' built from my list?
Each line is trimmed of surrounding whitespace; blank lines are dropped; the remaining strings are inserted into a JavaScript Set, which deduplicates exact-match duplicates. The result is what gets compared.
Is the comparison case-sensitive?
Yes. 'apple' and 'Apple' are treated as different items because Set uses strict string equality. Lowercase both lists with a separate text-case tool first if you need case-insensitive matching.
How is symmetric difference computed?
Run A − B and B − A separately and concatenate the two outputs — that gives the symmetric difference (items in exactly one of the lists). The four buttons cover every common pairwise set operation.
Does the order of items matter?
No — these are set operations, not multiset (bag) operations. Duplicates inside a single list collapse to one entry, and output order is the iteration order of the underlying Set, which is insertion order in modern engines.
Explore the full suite of Text tools and 290+ other free utilities at Chunky Munster.