Compare Two Lists
Paste two lists to see items in both, only in List A and only in List B, with a similarity score, sort buttons, copy per group and a text report.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the List Comparison tool?
Compare Two Lists treats each list as a set of lines and shows three groups: items in both lists, items only in List A and items only in List B. The comparison updates as you type, with counts for each group and a similarity percentage.
Matching is case-insensitive by default, with Trim whitespace and Ignore empty lines on, and each can be switched. Results keep the spelling of the first occurrence, so "Apple" in List A and "apple" in List B are reported as the common item "Apple". Duplicates within a list are counted once.
Sort buttons beside each list sort that list in place, A to Z or Z to A. Each result group has a Copy button, and Download Report saves a plain-text summary with your settings and all three groups. Everything runs in your browser.
- Common, only-in-A and only-in-B groups, updated as you type
- Case, trim and empty-line options
- Dice similarity percentage
- Sort either list A to Z or Z to A
- Copy each group or download a text report
- Runs in your browser; nothing is uploaded
Updated
How to use the List Comparison tool
- Paste the first list into List A and the second into List B, one item per line.
- Set Case sensitive, Trim whitespace and Ignore empty lines to match your data.
- Read the Comparison Summary: item counts, similarity, and the size of each group.
- Open the Common, Only A or Only B tab and click Copy, or click Download Report for everything.
- Optionally use the arrow buttons beside a list to sort it A to Z or Z to A.
Worked example
Case-insensitive comparison
Input
List A: Apple, Banana, Cherry (one per line) List B: apple, Date (one per line)
Output
Common: Apple Only in A: Banana, Cherry Only in B: Date Similarity: 40%
Apple and apple match because Case sensitive is off, and the result keeps the List A spelling. Similarity is 2 x 1 / (3 + 2) = 40%.
Background and insight
This is set algebra: the intersection A ∩ B, and the two differences A \ B and B \ A. The Unix tool for it is comm, which needs both inputs sorted and prints three columns; comm -12 a b gives the intersection, comm -23 a b the items only in a. In a spreadsheet the usual approach is a COUNTIF or XLOOKUP against the other column. Both work, but both trip over case and trailing spaces, which this tool normalises for you.
The similarity score is the Sørensen-Dice coefficient: 2 x |common| / (|A| + |B|), using distinct items. Two identical lists score 100%; lists with nothing in common score 0%. Dice weights shared items more heavily than the Jaccard index, |A ∩ B| / |A ∪ B|, so for the same lists Dice is always at least as high. Neither number says anything about order.
Because lists are compared as sets, a line that appears three times in List A and once in List B is simply "common". If you need to know about the repeats, run each list through Find Duplicate Entries first. If order matters, as in two versions of a file, use a diff tool instead.
Common use cases
Reconciling records
Find invoice numbers or order IDs that exist in one system export but not in the other.
Access reviews
Compare who has access to a system against the current staff list to find accounts that should be removed.
Mailing list changes
See which subscribers were added or dropped between two exports.
Dependency checks
Compare installed packages on two servers, or feature flags in two environments.
Tips and limitations
- Turn Case sensitive on for IDs, tokens and file paths where case matters.
- Items are compared as whole lines. "Smith, John" and "John Smith" do not match; normalise formats before comparing.
- Item counts in the summary are distinct items, so they can be lower than your line counts if a list has duplicates.
- Sorting rewrites the text in the box (trimming lines and removing blanks if those options are on). Sorting does not change which items match.
- The comparison needs both lists to be non-empty; with one empty list the results stay blank.
Sources and further reading
- comm invocation, GNU Coreutils. The Unix set-comparison tool and its sorted-input requirement
- Measures of the Amount of Ecologic Association Between Species, Ecology. Lee Dice's 1945 paper that introduced the Dice coefficient
- XLOOKUP function, Microsoft Support. The spreadsheet approach to matching two columns
Frequently asked questions
How do I find items that are in one list but not the other?
Paste the lists into List A and List B and open the Only A tab for items missing from List B, or Only B for items missing from List A. Each tab has a Copy button. By default the comparison ignores case and surrounding spaces, so formatting differences do not count as missing items.
How is the similarity percentage calculated?
It is the Dice coefficient on distinct items: twice the number of common items divided by the total distinct items in both lists. Lists A = {a, b, c} and B = {a, d} share one item, so similarity is 2 x 1 / (3 + 2) = 40%. Order and duplicates do not affect it.
Does the list comparison ignore duplicates and order?
Yes. Each list is reduced to its distinct items and compared as a set, so neither order nor repeats affect the result. If List A contains "x" three times and List B once, "x" is simply common. Use Find Duplicate Entries on each list if the repeats matter.
How do I compare two columns in Excel without formulas?
Copy each column, paste one into List A and the other into List B, and read the three groups. In Excel itself you would use COUNTIF or XLOOKUP in a helper column, and Excel matching is case-insensitive like this tool's default.
Should I use List Comparison or a diff tool?
Use List Comparison when the lines are independent items and order does not matter, such as IDs or emails. Use a diff tool when order and position matter, such as two versions of a file or config, because a diff shows where lines were inserted, removed or changed.
Is there an in-depth guide to the List Comparison tool?
Yes. “Cleaning Up Text Lists: Spaces, Blank Lines, Duplicates and Commas” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.