CSV Diff
BetaCompare two CSV or TSV files by a key column and list the rows that were added, removed or changed. Runs in your browser; the files are not uploaded.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
- Runs in your browser · nothing is uploadedIn your browser · no upload
- No AI · exact comparisonNo AI
File A
before0 rows · 0 colsDrop the before export here, or
Add the before export (.csv, .tsv)
.csv .tsv .txt
…or paste CSV / TSV text here
File B
after0 rows · 0 colsDrop the after export here, or
Add the after export (.csv, .tsv)
.csv .tsv .txt
…or paste CSV / TSV text here
Key column
Pick more than one for a composite key.Tap more than one for a composite key.
Column names appear here once both files have a header row. We suggest the one that is unique in both.
Nothing to compare yet
Add the before and after exports. Rows are matched on a key column, and every added, removed and changed row is listed here.
- 1Add File A and File B
- 2Pick the key column
- 3Review, then download
Why Use CSV Diff?
CSV Diff compares two tables, not two texts. Each file is read with a CSV parser that follows the usual quoting rules: a field in double quotes may contain the delimiter or a line break, two double quotes inside it stand for one, and a quote in the middle of an unquoted field is an ordinary character. The delimiter is detected separately for each file from its first line, so a comma-separated export can be compared with a tab-separated one. Blank lines are skipped, and empty or repeated header names are given unique names such as column_3 or email_2.
In key mode each row is matched by the value of one or more key columns. A key found only in File B is added, a key found only in File A is removed, and a key found in both is changed when any other column that both files share holds a different value. Trim whitespace, on by default, ignores spaces around key values, and Ignore case matches keys without regard to letter case; neither changes how other cells are compared. When a key appears more than once in a file, the first row is compared and the repeats are reported. In whole row mode there is no key: identical rows cancel out, counting repeats, and the rest are added or removed.
The download csv-diff.csv has a change_type column, then every column of File A followed by the columns only File B has, then an old_ column for each column that changed in at least one row. Removed rows hold File A's values; added and changed rows hold File B's, and the old_ columns hold File A's value on changed rows. Unchanged rows are counted but left out. The ZIP holds the same rows split into added.csv, removed.csv and changed.csv.
A quote that opens and never closes stops the comparison with the file and line number, because the rest of the file would otherwise be read as one field. To look through a single file, use the CSV Viewer; to combine files, use the CSV Merger; to remove repeated rows first, use CSV Dedupe.
How it compares
A line diff such as Diff Checker compares two files line by line. That works for code, but a CSV export sorted differently shows almost every line as changed, and one edited cell shows as a whole line removed and another added. CSV Diff matches rows by key instead, so a row that only moved is not a change, and an edited row is listed once with the columns that differ. For JSON data, use JSON Diff, which compares the parsed structure in the same way.
Tips for Comparing CSV Files
- Pick a key that identifies one real thing in both files, such as an ID. Matching on a column that itself can change, like an email address, turns an edited row into one removed row and one added row.
- If the note says the key is not unique, add a second column to the key. Until then only the first row for each repeated key is compared, and the others are listed in the warning.
- Trim whitespace and Ignore case apply to matching keys only. Other cells are compared exactly, so a trailing space in a name still counts as a change.
- Columns that exist in only one file are listed in the notes and not compared. Rename a header in one file if the same column is spelled differently.
- Whole row mode needs no key: it counts identical rows in both files and lists the rest as added or removed, which suits tables with no ID column.