ListCompare

How to Compare Two CSV Files

Comparing CSVs by key column versus comparing whole rows, plus the pitfalls that make two identical-looking files report hundreds of differences.

Updated 2026-11-29

Comparing two CSV files sounds simple and usually is not. The reason is that there are two different questions hiding behind it, and they need different tools.

Question 1: which rows exist in one file but not the other

This is a set comparison on a key column — usually an ID, SKU or email. Sort both by the key, or load both into a tool and compare the key columns.

Question 2: which rows changed

This needs a row-level diff: same key, different values. That is a different operation and usually wants a proper diff tool rather than a list comparator.

The four things that produce false differences

Line endings. A file saved on Windows uses CRLF, on macOS LF. A naive line comparison sees every row as different. Normalize first.

Byte order mark. Excel prepends a BOM to UTF-8 CSVs. The BOM attaches itself to the first value of the first column, so the first row never matches.

Quoting and escaping. "Smith, John" and Smith, John are the same value with different quoting. Compare parsed fields, not raw text.

Numeric formatting. 1,001 and 1001 are the same number and different strings. Decide which representation is canonical before comparing.

A quick workflow that avoids all four

1. Open both files and confirm they have the same column order.

2. Export the single column you want to compare from each file.

3. Paste both columns into a list comparison tool with trim and ignore-case enabled.

4. Export the result as CSV and work from that, not from the original files.

This sidesteps encoding, quoting and line-ending issues entirely, because you are comparing values rather than bytes.

When to use a real diff tool

If you need to know that row 42 changed its price from 19.99 to 21.99, a line-based diff such as git diff --no-index or a CSV-aware diff tool is the right choice. A list comparator will only tell you that the row's key is present on both sides.

Compare your own lists

Paste two lists and see what is only in A, only in B, and in both — then export the result as CSV.

Open the list comparison tool →