How to compare CSV files by key

Find added, removed and changed CSV records even when rows move, with two downloadable sample files.

Updated October 15, 2026 · SheetClarity

Why matching by row position can be misleading

A CSV export can contain exactly the same records in a different order. If you compare line 2 with line 2, a sort change can look like a data change. Matching by a stable identifier lets you compare the same product, customer or order line wherever it appears.

SheetClarity compares CSV values using the identifying columns you choose. It reports added and removed records, modified cells and rows that need review. The comparison runs in your browser without uploading the files.

Try a product-list example

These small files use fictional product data. Download both, open the comparison tool and choose the original and updated versions.

Original CSV

SKU,Price,Stock
00123,10,20
00124,15,5
00126,8,2

Updated CSV

SKU,Price,Stock
00124,15,5
00123,12,18
00125,22,8

Compare the files by SKU

  1. Select the two downloaded CSV files in the workspace.
  2. Confirm the sheet pair. A CSV is represented as one sheet; pair the original with the updated sheet if their names differ.
  3. Enter SKU as the identifying column on both sides.
  4. Leave comparison settings at their defaults and run the comparison.
  5. Read the summary, inspect the individual changes and download the Excel report.

The example produces one added row (00125), one removed row (00126), one modified row (00123) and one unchanged row (00124). Product 00123 contributes two modified cells because both Price and Stock changed. Sorting 00124 ahead of 00123 does not itself count as a change.

Choose keys that describe the record

Use a product ID for a product record. For order lines, a composite key such as Order, Line may be necessary. Both key fields must correspond in the same order across the two versions. Do not use a value that normally changes, such as price, as the identifier for a price comparison.

Missing or duplicate keys are flagged rather than guessed. Key matching uses text representations: numeric 1 can match text “1”, but “001” remains different from “1”. Spaces and letter case in keys remain significant. The optional text-normalization settings apply to compared cell values, not identifiers. See how to choose row keys before relaxing comparison settings.

Check delimiters, headers and cell types

CSV exports can differ in delimiters, quoting, encoding and date representations. Keep headers in the first row, check that each field appears as a separate column in the key names, and use a small known example to confirm the import. If an export appears as one combined column, save a comma-separated copy with quoted fields where needed. Keep the original export unchanged.

Data columns are compared by header name, not column position. Renaming “Price” to “Unit price” creates a different field. Align the names in working copies if they mean the same thing. Dates stored as text remain text; changing “10/12/2026” to “2026-12-10” can therefore be reported even if both represent the same day in your business process.

Export a useful audit trail

The Excel report includes the summary, all detailed changes and review flags. The CSV export contains the changes table, and the printable HTML report includes all three sections. Downloaded CSV strings that look like formulas receive an apostrophe prefix as a safety measure, which changes their literal representation.

Keep your source versions with the report and resolve flagged identifiers before using the results to update stock or prices. Read how to interpret the report if the number of modified rows differs from the number of detailed cell changes.

Compare CSV files →All comparison guides