← CSV Repair & Deduper (offline browser tool)

How to compare two CSV files and find what changed

Ways to diff two versions of a CSV export (e.g. this month's list vs. last month's) to see which rows were added, removed, or changed.

Before you work through this by hand: you can check your own CSV free and see which of these problems your file actually has — duplicate rows, near-duplicates, broken quoting, encoding damage. It runs in your browser tab, nothing is uploaded, and there's no signup or email.

Option 1: Sort both files first, then diff as text

If both files have the same columns, sort each by a stable key column (like an ID or email) and save them, then compare with a plain text diff tool (e.g. the diff command on Linux/macOS, or a text-compare tool on Windows). This shows added/removed lines clearly, but only works well if rows are otherwise identical.

Option 2: pandas merge with an indicator column

import pandas as pd; a = pd.read_csv('old.csv'); b = pd.read_csv('new.csv'); diff = a.merge(b, how='outer', indicator=True); print(diff[diff['_merge'] != 'both']) — this shows exactly which rows exist only in the old file, only in the new file, or (if you merge on a key column instead of the whole row) which rows changed.

The near-duplicate trap

Both methods above only find exact matches. If the "same" record was re-exported with a slightly different spelling, capitalization, or extra whitespace, it will show up as both "removed" and "added" instead of "unchanged" — which can make a diff look far noisier than it really is. This is the same near-duplicate problem covered in our duplicate-removal guide, just applied across two files instead of within one.

$19 one-time payment. No subscription. If you'd rather skip the manual steps above, CSV Repair & Deduper (offline browser tool) automates the duplicate-finding and review step for you, entirely on your own device.

See CSV Repair & Deduper (offline browser tool) — $19 one-time

See all free guides