List Difference (A − B)
Calculate the set difference between two lists. Find items in List A that don't appear in List B. Free online tool, client-side processing.
Why Use the List Difference Tool?
Set difference is essential for identifying missing items, tracking changes, or finding elements present in one dataset but absent from another. Our List Difference Tool computes A minus B — all items in List A that are not in List B — instantly and accurately.
Key Features
- Compute set difference A − B with deduplicated results
- Clear labeling of source and subtraction lists
- Item count statistics for both input lists
- One-click copy of difference results
How to Use
- Enter items in List A (the source list)
- Enter items in List B (items to subtract)
- View items that exist in A but not in B
Technical Details
The set difference A − B is computed using JavaScript Set for O(1) lookup of List B items. Each item from List A is checked against the Set of List B items. Only items not found in B are included in the result, with duplicates automatically removed. Time complexity is O(n+m).
FAQ
What is the difference between this and the Intersection tool?
The Intersection tool finds items common to both lists. The Difference tool finds items in A that are NOT in B. They are complementary operations.
Does order matter? What if I swap A and B?
Yes, order matters. A − B gives different results than B − A. If you need items in B but not A, simply swap the lists.
Related tools
Compare Two Lists / Arrays
Compare two lists and find items unique to each, plus common items
List Randomizer / Shuffle
Shuffle and randomize list items using the Fisher-Yates algorithm
List Intersection (Common Items)
Find common items between two lists with case-sensitive toggle
List Union (Merge & Dedupe)
Merge two lists together and remove duplicates
Remove Empty Lines
Remove empty and blank lines from text instantly
Add Line Numbers
Add line numbers to text with customizable start number, separator, and padding