CSV

CSV Diff — Compare Two Files by Key

Compares two files on a key column and reports added, removed and changed values.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the earlier version on the left and the later one on the right.
  2. Name the column that identifies a row in both files.
  3. Compare, then read the change column to see what was added, removed or altered.

What csv diff does

A plain text diff of two extracts is nearly useless, because a single reordered row makes every line after it look changed. Comparing by key instead of by position gives an answer that means something: this identifier is new, this one has gone, and on this one the status column changed from active to closed.

Only columns present in both files are compared, and the result names the column and shows both values side by side, so a change is legible without going back to the sources. Rows are matched on the key column you nominate, so the comparison is only as reliable as that key — if it is not unique, the first matching row wins and the rest are not compared.

Frequently asked questions

Because a single reordered row makes every later line look changed. Matching on a key gives an answer in terms of records rather than lines.

Only the ones present in both files. A column that exists in one file alone cannot be compared, and is left out of the result.

The first matching row wins and the rest are not compared. Run the column profiler on both files first if you are not certain the key is unique.