How to Compare Two Lists and Find Missing or Extra Items
Find which names, emails or IDs are in one list but not the other. Clean and sort both lists, compare them line by line, and read the results correctly.
The short answer
To compare two lists, put one item per line, remove duplicates and sort both lists the same way, then paste them into the Text Diff Checker. Lines marked as removed are only in the first list, lines marked as added are only in the second, and unmarked lines are in both. Sorting first matters: without it, the same item can appear as both removed and added.
This works for attendance lists, email lists, product codes, invoice numbers, or any two lists of short items.
Step 1: Put one item per line
Most lists arrive in one of three shapes:
- A column copied from Excel or Google Sheets. This already pastes as one item per line.
- Comma-separated text, such as "Aarav, Diya, Kabir". Paste it into a spreadsheet, split it into columns at the commas (Data > Split text to columns in Google Sheets, or Data > Text to Columns in Excel), then copy the row and use Paste special > Transpose to turn it into a single column.
- A list with extra details, such as "Aarav Shah - Class 9B". Decide what you are comparing. If one list has class names and the other does not, the lines will never match. Remove the extra part from both lists, or compare a single field such as roll number or email.
Step 2: Remove duplicates, trim spaces and sort
Open Remove Duplicate Lines and paste the first list. Turn on:
- Trim whitespace, so a trailing space does not make "Meera " differ from "Meera".
- Sort result, so the list is alphabetical.
- Case sensitive off, if "meera" and "Meera" should count as the same person.
Click Remove Duplicates, copy the result, then do exactly the same with the second list, using the same settings. Empty lines are dropped too, which avoids blank lines being reported as differences.
You can also use Sort Text Lines, but both lists must be sorted the same way. If you are comparing numbers such as invoice IDs, the guide to alphabetical vs numeric sorting explains why the order can look odd; as long as both lists use the same order, the comparison still works.
Step 3: Compare the lists
The checker compares the two texts line by line and finds the longest run of lines they share, so lines present in both stay aligned even when items are missing in between.
Step 4: Read the result
Take these two class lists, already sorted:
| Original Text (register) | Changed Text (today's attendance) |
|---|---|
| Aarav | Diya |
| Diya | Ishaan |
| Kabir | Kabir |
| Meera | Meera |
| Rohan | Sara |
| Sara | Zoya |
The checker shows:
- Aarav and Rohan marked with a minus and crossed out: in the register but not in today's list.
- Ishaan and Zoya marked with a plus: in today's list but not in the register.
- Diya, Kabir, Meera, Sara unmarked: in both lists.
Above the result, the summary shows the counts, here +2 added and −2 removed, and a similarity percentage. The similarity is the share of result lines that match, so it is a quick sense check rather than a precise measure for lists.
The line numbers on the left show where each line sits in the original and changed text, which helps if you need to find an item in the source file.
Why sorting matters
The checker compares lines in order. If two lists hold the same names in a different order, some names will be reported as removed from one place and added in another, even though nothing is missing.
For example, comparing "Rohan, Aarav, Meera, Diya" with "Diya, Meera, Rohan, Aarav" (one per line) marks Diya and Meera as both added and removed. Once both lists are sorted alphabetically, the checker reports no differences.
When both lists are sorted the same way and contain no duplicates, the removed lines are exactly the items only in the first list, and the added lines are exactly the items only in the second.
Practical uses
- Attendance and registrations: compare a sign-up list with the people who attended.
- Email lists: find addresses in your new export that are not in your old one. Make everything lowercase first, because email addresses are often typed with inconsistent capitals.
- Stock and inventory: compare product codes in your system with codes from a stock count.
- Payments: compare invoice numbers sent with invoice numbers paid.
- File lists: compare two folder listings to see which files are missing from a backup.
Troubleshooting
Everything shows as different. Check for hidden differences: one list may use tabs, a different separator, or a prefix such as a number. Look at one line from each list character by character.
Names with different spellings do not match. "Mohd" and "Mohammed" are different text. A line comparison cannot know they are the same person. Compare a unique field such as a roll number or email address instead.
Duplicates hide a missing entry. If "Kabir" appears twice in the first list and once in the second, the extra copy shows as removed. Remove duplicates first unless the count itself matters.
Very long lists are slow. The comparison checks every line of one list against every line of the other, so lists with many thousands of lines can take longer in the browser. Split very long lists into alphabetical batches if needed.
When you need more than a list comparison
If you are comparing two versions of a document rather than two lists, paste the full text and skip the sorting step. The guide to comparing two texts covers that use.
Summary
Frequently asked questions
How do I find items that are in one list but not the other?
Put one item per line, remove duplicates and sort both lists the same way, then compare them in a text diff checker. Removed lines are only in the first list; added lines are only in the second.
Why does the comparison show items as removed and added when both lists contain them?
The diff compares lines in order. If the lists are in different orders, a matching item can appear as removed in one place and added in another. Sort both lists first.
Can I ignore capital letters and extra spaces?
Yes. Tick Ignore case and Ignore whitespace in the Text Diff Checker so that 'Meera' and 'meera ' count as the same line.
Is it safe to paste a list of emails or customer IDs?
The Text Diff Checker compares the text in your browser; it does not send the lists to a server.
Put this guide into practice with our free online tool — no signup required.
Open tool