---
title: "CSV Diff"
description: "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."
url: https://findutils.com/convert/csv-diff/
category: convert
---

# CSV Diff

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 this tool:** [CSV Diff](https://findutils.com/convert/csv-diff/)

## Programmatic access

- REST id `csv-diff`: POST https://api.findutils.com/api/tools/csv-diff/execute (reference: https://findutils.com/api/csv-diff/)
- MCP tool `csv_diff` on https://mcp.findutils.com (reference: https://findutils.com/mcp/csv-diff/)

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

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

## Related Tools

- [CSV Viewer](https://findutils.com/convert/csv-viewer/)
- [CSV Merger](https://findutils.com/convert/csv-merger/)
- [CSV Dedupe](https://findutils.com/convert/csv-dedupe/)
- [JSON Diff](https://findutils.com/developers/json-diff/)
- [Diff Checker](https://findutils.com/text/diff-checker/)
- [SQL to CSV](https://findutils.com/convert/sql-to-csv/)
