Toolvore

CSV Compare by Key

Compare CSV exports by a unique key. Preserve string IDs and inspect added, removed and changed records.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

CSV Compare by Key matches exact string IDs across two CSV versions and reports changed, added and removed records, with duplicate and missing keys disclosed before matching.

How to use it

  1. 1Paste or load the before and after UTF-8 CSV files with header rows.
  2. 2Enter a unique key column's exact header and choose the delimiter.
  3. 3Compare, resolve any key issues, and download the full JSON difference report.

Example

Input
Before: id,status 001,pending 002,active After: id,status 003,active 001,active
Output
1 changed, 1 added, 1 removed, 0 unchanged records.

Key 001 matches despite moving to another row.

What happens to your data

Comparison happens on your device without uploads. Downloaded reports include full keys, changed values and added or removed rows.

Last updated October 2026

CSV Compare by Key shows what changed between two exports when rows have moved. Give both files a named header row and select one unique key column, such as id or SKU. The tool matches the same key across versions and reports added rows, removed rows, changed cells and unchanged records. Column order can also change without creating false differences.

Every CSV value stays a string. An ID of 001 does not turn into 1, and a very long account identifier does not lose digits. Matching is case-sensitive and preserves spaces. Duplicate or missing keys make a comparison ambiguous, so the tool stops and lists the source records to fix before presenting differences.

How it works

Both files are read with strict quoting and checked for a consistent field count. Headers must be nonempty and unique, and the selected key header must exist in both versions with its exact spelling. Data keys must contain a non-whitespace character. One key column is supported; create a stable composite key in your source system if several fields together identify a row. Neither row position nor inferred numeric types determines a match.

For matched keys, columns are aligned by exact header name. Added and removed columns are reported as schema changes and count as changed cells for each affected matched row. The report uses null to mean a column is absent in a version; an existing empty cell is the empty string. Changes to the literal text of a value count even if an application would consider the values equivalent. Different quote escaping that decodes to the same CSV string does not count.

The on-page preview shows at most 50 changed cells and abbreviates long values. Download the JSON report for full changed values and the complete added and removed rows. JSON keeps formula-like text as strings instead of creating executable spreadsheet cells. The report still contains your data, so treat the saved file with the same care as the originals. Issue reports show at most 100 locations and retain the full issue count.

Each input is capped at 2 MiB, 10,000 records including the header, 200 columns and 200,000 cells. Reports have a 16 MiB cap, and especially expansive reports may be refused earlier to keep browser memory bounded. Both files use the chosen delimiter. Processing stays on your device, and edits clear the previous comparison immediately.

Worked example: Match reordered rows by their string ID

Input
Before: id,status 001,pending 002,active After: id,status 003,active 001,active
Result
1 changed record (001), 1 added record (003), 1 removed record (002), 0 unchanged records.

The changed status is pending → active. Row position does not decide the match.

Common use cases

  • Reviewing a customer export before and after an update
  • Finding changed product fields between two catalog snapshots
  • Checking which keyed records were added or removed from a report
  • Auditing an export whose row and column order changed

Frequently asked questions

Why does comparison stop for duplicate keys?+

Two rows with the same key have no unambiguous one-to-one match. Keeping the first row or matching by position would invent a result. Fix the duplicates or choose a truly unique key, then compare again.

Are leading zeros and large IDs preserved?+

Yes. CSV fields are decoded as strings without numeric conversion. Keys 001, 1 and 9007199254740993 retain their exact text. An upstream spreadsheet might already have changed an identifier before export; this tool cannot reconstruct lost digits.

Do spaces and uppercase letters matter?+

Yes, in headers, keys and values. There is no automatic trimming, case folding or date normalization. A key containing only whitespace is rejected as missing, while spaces around an otherwise nonempty key remain significant.

Can column order change between files?+

Yes. Columns match by header name. Reordering identical columns and rows produces no differences. New or missing columns are shown separately and also appear in the changed-cell report for matched keys.

Why is the downloadable comparison JSON instead of CSV?+

JSON can represent rows, cell changes and absent columns without flattening the report. It also stores text beginning with =, +, - or @ as strings. The report contains full keys and values; sharing it shares that data.