How to Compare Two Lists and Find the Differences

Ashwin Karthik
Updated •
Software, Windows Software

To compare two lists, put one item per line in each list, then run a set comparison that returns three results: items in both lists, items only in list 1 and items only in list 2. On Windows you can do this offline with Vovsoft Compare Two Lists, with a COUNTIF formula in Excel or Google Sheets, or with one PowerShell command. Normalize case and spaces first, or near-identical entries will show up as differences.

This guide shows each method step by step, explains when a list comparison is the wrong tool (and a file diff is the right one), and gives copy-ready formulas and commands.

Compare Two Lists main window with List #1 and List #2 side by side

What comparing two lists actually returns

Comparing two lists is a set operation: it checks membership, not position, so it tells you which items exist in one list, the other, or both, regardless of order. Every list comparison tool produces some version of these outputs:

Result Set term Typical use
In both lists Intersection Customers on both mailing lists, files present in two backups
Only in list 1 Difference (A minus B) Items that were removed, invoices not yet paid
Only in list 2 Difference (B minus A) New entries, items added since the last export
All unique items Union A merged master list without repeats

Because order is ignored, "Milk" on line 3 of one list and line 8 of the other counts as a match. That is exactly what you want for names, email addresses, SKUs, URLs or keywords. It is not what you want when you need to see how two versions of a document changed line by line; that job belongs to a file comparison tool, covered further down.

How to compare two lists with Vovsoft Compare Two Lists

Vovsoft Compare Two Lists is a small Windows program that compares two lists offline and shows the matches and differences in separate views. The current version is 1.7 (April 2026). It runs on Windows 7 to Windows 11, comes as an installer or a portable build, and handles up to 100 million items per list according to the developer. It is free to try; a $19 license removes ads and nag screens and unlocks unlimited export and commercial use.

  1. Download it from the official Vovsoft product page.
  2. Fill the left pane (List #1): click Load to import a .txt file, drag and drop a file, paste from the clipboard or type the items, one per line.
  3. Fill the right pane (List #2) the same way.
  4. Set the options: case-sensitive or case-insensitive matching, and ignore whitespace if your data comes from different sources.
  5. Click Compare and read the results window.
  6. Select the result view you need and save it as a text file, choosing the output encoding.

The program only opens plain text files. For Word, PDF or web content, copy the text and paste it into the pane. Pasting through Notepad first strips formatting and keeps one item per line.

Two lists loaded in Compare Two Lists before running the comparison

In the early 2021 build shown in these screenshots, the results window has six tabs: Common (in both lists), Only #1, Only #2, All (both lists merged) and the two original lists. Each tab can be saved on its own.

Compare Two Lists results window with Common, Only #1 and Only #2 tabs

Remove duplicates and clean the lists first

Cleaning both lists before you compare them is the step that decides whether the result is trustworthy. Most "false differences" come from formatting, not from real changes. Run through this checklist:

  • One item per line, with no trailing commas or semicolons from CSV exports.
  • Same case, or use a case-insensitive comparison ("Apple" and "apple" are different strings otherwise).
  • No leading or trailing spaces; enable ignore whitespace or trim the data in a spreadsheet with TRIM.
  • Same format for numbers, dates and phone numbers (0049 and +49 never match).
  • Duplicates removed inside each list, so counts reflect unique items.

Compare Two Lists has a Remove duplicates button under each pane that deletes repeated lines from that list. In the shopping list example below, the second "Milk" disappears. Version 1.6 fixed a bug in this function, so use a current build if older versions mangled your text.

Remove duplicates button deleting a repeated item from a list in Compare Two Lists

Compare two lists in Excel or Google Sheets

Excel and Google Sheets compare two lists with COUNTIF, which counts how often each item of one list appears in the other: a count of 0 means the item is missing. Put list 1 in column A and list 2 in column B, starting in row 2.

In Excel for Microsoft 365, Excel 2021 or Excel 2024, the FILTER function returns each result as a spilled list:

  • Only in list 1: =FILTER(A2:A500, (A2:A500<>"")*(COUNTIF(B2:B500, A2:A500)=0), "")
  • Only in list 2: =FILTER(B2:B500, (B2:B500<>"")*(COUNTIF(A2:A500, B2:B500)=0), "")
  • In both lists: =FILTER(A2:A500, COUNTIF(B2:B500, A2:A500)>0, "")

The (A2:A500<>"") part skips empty rows at the end of the range, and the third argument ("") prevents a #CALC! error when nothing matches. In older Excel versions, add a helper column in C2 with =IF(COUNTIF($B$2:$B$500, A2)=0, "Only in list 1", "In both"), fill it down and filter the column. Adjust the ranges to your data; this guide on jumping to the last row with data helps you find where long lists end.

Google Sheets uses the same logic with open ranges: =FILTER(A2:A, A2:A<>"", COUNTIF(B2:B, A2:A)=0) lists items only in column A. In Sheets, FILTER returns #N/A when there are no results.

Two limits matter. COUNTIF is not case sensitive in Excel or Google Sheets, and in Excel it treats ? and * as wildcards, so items containing those characters can match the wrong entries. Excel's COUNTIF also returns wrong results for strings longer than 255 characters. For a quick visual check instead of formulas, select both columns and use Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values: once duplicates inside each list are removed, cells that stay unhighlighted exist in only one list.

Compare two lists with PowerShell or the command line

PowerShell compares two text files with Compare-Object, which is built into Windows and needs no extra software. Save each list as a text file with one item per line and run:

Compare-Object (Get-Content .\list1.txt) (Get-Content .\list2.txt) -IncludeEqual

The SideIndicator column marks every line: <= means only in list1.txt, => means only in list2.txt and == means in both. Drop -IncludeEqual to see differences only, or add -ExcludeDifferent together with -IncludeEqual to see matches only. Comparisons are case-insensitive unless you add -CaseSensitive, as described in the Compare-Object documentation. Append | Out-File result.txt to save the output.

On Linux and other Unix-like systems, comm does the same job, but it requires sorted input. In Bash, sort and deduplicate on the fly:

  • Only in list 1: comm -23 <(sort -u list1.txt) <(sort -u list2.txt)
  • Only in list 2: comm -13 <(sort -u list1.txt) <(sort -u list2.txt)
  • In both lists: comm -12 <(sort -u list1.txt) <(sort -u list2.txt)

The numbers name the columns comm hides: column 1 is lines unique to the first file, column 2 lines unique to the second, column 3 lines in both.

Which list comparison method to use

The right method depends on where the lists live, how big they are and whether the data may leave your computer. All four options below work offline.

Method Best for Watch out for
Vovsoft Compare Two Lists Pasted or .txt lists, one-off checks, no formulas Windows only; free trial shows ads and limits export
Excel or Google Sheets Lists that already sit in a spreadsheet, results you want to keep next to the data Case-insensitive, wildcards in Excel, 255-character limit
PowerShell Compare-Object Repeatable checks, scripts, large exports on Windows Output needs filtering by SideIndicator
comm Linux servers, very large sorted files, pipelines Input must be sorted, and the locale affects sort order

Browser-based list comparison sites are convenient, but anything you paste goes to a third-party page. Keep customer data, email addresses and internal inventories in one of the offline methods.

When you need a file diff instead of a list comparison

A file diff is the better tool when the order and position of lines matter, for example when you compare two versions of a contract, a config file or source code. List comparison would tell you that a sentence exists in both versions, but not that it moved, and it cannot show changes inside a line.

Diff tools align both files line by line and highlight insertions, deletions and edits within lines. KDiff3 compares and merges files, Meld compares files and folders on Windows and Linux, and our roundup of free file comparison programs for Windows lists more options. Use a list tool for "what is in A but not B", and a diff tool for "what changed between version 1 and version 2".

FAQ

Does the order of items matter when comparing two lists?

No. A list comparison checks whether each item exists in the other list, so the same items in a different order produce no differences. If order matters, use a file diff tool.

Can I compare more than two lists?

Yes. Compare the first two lists, then compare the result with the third list. Vovsoft Compare Two Lists lists multiple-list comparison among its features, and in Excel you can add one COUNTIF condition per extra column.

How do I make the comparison case-sensitive in Excel?

COUNTIF ignores case, so use EXACT instead: =SUMPRODUCT(--EXACT(A2, $B$2:$B$500))=0 returns TRUE when the item in A2 has no exact, case-matching twin in column B.

Related: Textbrowser, a tabbed Notepad alternative with a compare text tool, File Synchronizer for comparing and syncing two folders

Comments

  1. unknow said on
    Reply

    I really appreciate your initiative and your blog approach it helps many people like myself.

    do visit my site for new and updated software : Colorschemer Studio Online

  2. MR MUSTASHE said on
    Reply

    No thanks!… if I can’t download it from CompareTwoLists.com (forcing me to upload otherwise PRIVATE MATERIAL!), then why would I want to– why should I want to!– download this “freeware” from Softonic? And incidentally, just because it’s said FREEWARE, doesn’t mean that it is “FREE AND OPEN SOURCE SOFTWARE (FOSSware… FOSS)”!

    P.S.:…

    ATTENTION GHACKS.NET; In Checking the box to consent to my data being stored in line with the “guidelines” set out in Ghacks’ “Privacy Policy”… and, in order for my comment to be posted!… I give NO SANCTION to/ for a violation of my Constitutionally protected Rights and Freedoms, nor to/ for a violation of any of the “Articles” to be found within the “Universal declaration of Human Rights”/ UDHR! And this applies to any previous comments posted at Ghacks, and to any comment yet to be posted!

  3. Anonymous said on
    Reply

    You write: Unfortunately, the remove duplicate option does not work well with text documents, sentences, etc.

    That says it all and the verdict is obvious.
    So WHY do you make a review of this SW. Save your and my energy!

    Regards, Jan

  4. Anonymous said on
    Reply

    Man diff.

  5. Anonymous said on
    Reply

    I use WinMerge.

  6. VioletMoon said on
    Reply

    MS Office Suite, Open Office, Libre, etc. all have the compare/combine tools, but I think for the small stuff I prefer using Notepad++ and the two plugins available.

    WinMerge is quite capable.

  7. S. Smith said on
    Reply

    You can also achieve this with the COUNTIF formula in a spreadsheet.

    1. Steve said on
      Reply

      Or even simplier: use Windows’ file comparison (fc.exe).

      More info at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fc

Leave a Reply

By commenting, you accept our privacy policy and keep the discussion respectful and on topic.