Skip to content

Convert

CSV Diff

CSV Diff

Beta

Compare 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.

Use via API
  • Free, no sign-up
  • REST + MCP
  • Updated
  • Reviewed by Olgun Ozoktas
  • In your browser · no upload
  • No AI
A

File A

before0 rows · 0 cols

Add the before export (.csv, .tsv)

…or paste CSV / TSV text here

Waiting for data
B

File B

after0 rows · 0 cols

Add the after export (.csv, .tsv)

…or paste CSV / TSV text here

Waiting for data

Key column

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.

Match by

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.

  1. 1Add File A and File B
  2. 2Pick the key column
  3. 3Review, then download

Why Use CSV Diff?

Two exports of the same table rarely come out in the same order. A customer list sorted by signup date one month and by name the next looks completely different to a line-by-line diff, even when only three customers changed plan. CSV Diff reads both files as tables, matches each row on a key column such as customer_id, and lists only the rows that were added, removed or changed. For a changed row it names the columns that differ and shows the old value next to the new one. The result downloads as one CSV with a change_type column, or as a ZIP with separate added, removed and changed files, so it can go straight into a spreadsheet, a ticket or an import job.

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.

Frequently Asked Questions

How do I compare two CSV files?

Put the older file in File A and the newer one in File B, by dropping, choosing or pasting it, then press Compare files. The page matches rows on a key column and lists every row that was added (only in B), removed (only in A) or changed (same key, different values), with a count for each and a count of unchanged rows.

Do rows in a different order count as changes?

No. Rows are matched by their key, not by their position, so a file sorted differently gives the same result. In whole row mode rows are matched by their full content, which also ignores order.

Can I match on more than one column?

Yes. Select several key chips to build a composite key, for example email and country. Two rows then match only when all the selected columns match, so the same email in two countries counts as two different rows.

What happens when a key appears more than once?

The first row with that key is compared and the later ones are not. A warning on the file names how many rows repeat a key and lists the repeated values, and the note beside the key chips says the key is not unique. Adding another column to the key usually makes it unique.

Does it work with TSV or semicolon-separated files?

Yes. With Delimiter set to Auto, each file's separator is detected from its first line: comma, tab, semicolon or pipe. The two files may use different separators. Choose a delimiter by hand if the detection picks the wrong one; it then applies to both files.

What does the downloaded diff CSV contain?

One row per difference. The first column, change_type, says added, removed or changed. Then come the columns of File A and any columns only File B has, and finally an old_ column for each column that changed somewhere, filled on changed rows with File A's value. Removed rows carry File A's values and added and changed rows File B's. The ZIP download splits the same rows into added.csv, removed.csv and changed.csv.

How large can the files be?

The two files together can be up to about 10 MB. When they are larger than about 2 MB the comparison runs in a background thread, so the page stays responsive while it works. The table on the page lists up to 100,000 differences; the counts and both downloads always include all of them.

Are my files uploaded?

No. Runs in your browser; the files are not uploaded. Analytics and ads may load on the page.

How is this different from VLOOKUP in Excel?

A VLOOKUP looks up one column from one sheet in another, so finding every added, removed and changed row takes several formulas, one per column, plus a filter for the rows that do not match. CSV Diff does the whole comparison in one step, handles composite keys and repeated keys, and gives you the differences as a file.

Can I use it from code?

Yes. The same comparison is the REST tool csv-diff at api.findutils.com and the MCP tool csv_diff at mcp.findutils.com. It takes the two tables as a and b, optional keys, mode, trim, ignore_case, delimiter and max_rows, and returns the counts, the rows and diff_csv.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool