99tools

CSV Diff

runs in your browser

Compare two CSV exports row by row on a key column: which rows are new, which are gone, and exactly which cells changed. Reordering rows changes nothing.

Two exports of the same table. Rows are matched on the key column rather than by line, so reordering them changes nothing and the answer is which cells moved.

Before

After

about this tool

Two exports of the same table, a week apart. Which rows are new, which are gone, and which cells actually changed.

Why a text diff fails here

Everybody tries it first. It does not work, for two reasons that have nothing to do with the diff being bad:

Reorder the rows and every line changes. A database export has no guaranteed order. Two dumps of identical data can produce completely different files, and a line diff will tell you everything changed.

Add a column and every line changes. One new field at the end rewrites every row, and the actual edit is somewhere in the noise.

Both happen because a line diff compares positions. What you want compared is rows, and a row is identified by its key.

The key column

The key is whatever identifies a row across both files — an id, an email, a reference number. Give it one and reordering becomes invisible: the tool finds the row with the same key in each file and compares them cell by cell.

A column whose values are unique in both files is picked for you as a starting point, preferring one called id. You can change it, and you should if you know the data better than the guess does.

When there is no key

Rows are matched by position instead, which behaves exactly like a line diff — insert a row near the top and everything below reads as changed.

That is offered rather than refused, because a file with no key still has an order and comparing is better than nothing. But the page tells you it has fallen back, every time, so a misleading result is never a silent one.

Everything is text

007 is not 7. 1-2 is not a date. 1.10 is not 1.1.

A CSV has no types, and a comparison that parses values will report differences that are not in either file. Every cell here is compared as the characters it contains.

What it tells you

Rows added, removed and changed, counted. Columns added or removed, named. A key that appears twice, flagged — because that makes the match ambiguous and only the first row with each key was compared.

Changed cells show the old value struck through above the new one, and every row carries a word as well as a colour, so the result survives being printed or read by somebody who does not see the difference between the two greens.

Nothing is uploaded

Both files are read in your browser. That matters here more than usual: what people compare is a customer list, a billing export or a staff spreadsheet.

For looking at one file rather than two, the CSV & Excel viewer opens it, and CSV cleaner fixes the encoding and delimiter problems that make two exports differ for no real reason.

questions

Why not just use a text diff on two CSVs?
Because a line diff answers the wrong question. Reorder the rows and every line looks changed; add a column and every line looks changed. Matching rows on a key column instead means reordering is invisible and the answer is which cells actually moved.
What is a key column?
The column that identifies a row across both files — usually an id, an email or a reference. It is what lets the tool say "this row changed" rather than "line 14 is different". A column whose values are unique in both files is suggested automatically.
What if my files have no key column?
Rows are matched by position instead, which behaves like a line diff: insert a row near the top and everything below it reads as changed. The page says when it has fallen back to this, so the result is never quietly misleading.
Does it treat 007 as the number 7?
No. Every value is compared as text, because a CSV has no types. Turning 007 into 7, or 1-2 into a date, is how a comparison invents differences that are not in the file.
Are my files uploaded?
No. Both files are read in your browser and never sent anywhere, which matters because what people compare is usually a customer list, an export from a billing system or a staff spreadsheet.