List Set Operations
Perform set operations on two lists: union, intersection, difference, A-only, B-only, and symmetric difference. Paste two lists and choose the operation — results update instantly.
A ∪ B (Union)
6
A ∩ B (Intersection)
2
A − B (only in A)
2
B − A (only in B)
2
A △ B (symmetric)
4
How to use the list set operations
Paste two lists, one item per line. The five common set results compute simultaneously: union, intersection, A only, B only, and symmetric difference.
Formula & explanation
Order is preserved from the first occurrence; duplicates within a list are collapsed in the output.
Examples
A: apple, banana, cherry, date. B: banana, cherry, elderberry. Intersection: banana, cherry. A−B: apple, date.
Frequently asked questions
- What is the difference between intersection and union of two lists?
- The intersection contains only items present in both lists; the union contains all items from either list with no duplicates.
- What is symmetric difference?
- Symmetric difference (A △ B) contains items that appear in either list but not both — the opposite of intersection.
- Does the tool handle case-insensitive comparison?
- Yes — uncheck 'Case sensitive' and 'Apple' and 'apple' will be treated as the same item.
- Are duplicates within a single list removed?
- Yes, each output set collapses duplicates so you get clean, unique results even if your original list had repeated entries.
Related list tools tools
- List StatsGet statistics on any list: total count, unique count, min and max line length, average length, and the longest and shortest items. Useful for auditing data before further processing.
- Comma to Lines ConverterConvert between comma-separated values and one-item-per-line format. Handles quoted fields, trims whitespace, and removes duplicates. Paste CSV data, get a clean list — and back.
- List FilterKeep or remove lines matching a plain-text substring or regular expression. Useful for filtering log output, cleaning data, or extracting matching lines from large lists.
- List to JSON ArrayConvert a one-item-per-line list into a JSON array of strings and back again. Handles quoting and escaping automatically — useful for turning clipboard lists into API payloads.
- Number Sequence GeneratorExpand range patterns like 1..100 or 0,2,4..20 into complete numeric lists. Supports step size, comma-separated output, and custom separators — great for test data and scripting.
- Column PickerExtract a specific column from tab-separated or comma-separated rows. Enter column index or name — useful for pulling a single field from TSV exports or pasted spreadsheet data.