SmartQueryTools

Compare CSV Files Online

Compare two CSV files directly in your browser. See rows only in file A, only in file B, and rows common to both — no upload required.

How to compare CSV files

  1. Drop the older file into the File A box and the newer file into the File B box. Each box shows the row and column count once the file has loaded.
  2. Click Compare. The tool first lists every column with a coloured dot: green for columns that match by name and type, yellow for a type mismatch, and blue or purple for columns found in only one file.
  3. Read the three summary cards: Only in File A, Only in File B, and In both files. Each card shows the full row count. Click a card or tab to preview up to 500 rows of that set.
  4. Click Download while a tab is active to save that set as a new file in the same format, for example prices_only_in_file_a.csv.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A supplier sends a new price list each month. You want to see which lines were dropped or repriced since last month, and which products are new.

Input (CSV)

sku,product,price
KB-101,Wireless keyboard,49.99
MS-220,Ergonomic mouse,34.5
HD-310,USB-C hub,59.99
CB-015,HDMI cable 2m,12.99

Settings

  • File A: last month's price list (shown above)
  • File B: this month's list. KB-101 and HD-310 are unchanged, MS-220 is now 32.0, CB-015 is gone, and DS-400 Laptop stand at 44.95 is new
  • Active tab: Only in A

Result

skuproductprice
MS-220Ergonomic mouse34.5
CB-015HDMI cable 2m12.99

Rows are compared on every shared column at once, so a repriced product counts as a different row. MS-220 appears in Only in A with its old price and in Only in B with its new price. Only in B also holds DS-400. In both holds KB-101 and HD-310. Row order within each set is not guaranteed.

Working with CSV files

Each CSV is typed separately on load, and a column is only used in the comparison when its name and type agree in both files. That catches people out with CSV. If last month's price column held only whole numbers it loads as BIGINT, and if this month's has one value like 12.5 it loads as DOUBLE. The schema panel marks it yellow and the column is left out of the match, so rows can look identical when they are not.

Header names must match exactly, including case and trailing spaces, so "Price" and "price" are treated as two different columns. Text values are compared byte for byte. A value with a trailing space, or one saved as "Acme" in one export and "ACME" in the other, lands in both Only in A and Only in B. Empty fields load as NULL and two NULLs count as equal. Downloads are written as comma-separated CSV with the header on the first line.

Frequently Asked Questions

Why does a CSV column show as a type mismatch when both files look the same?

Types are inferred from the values in each file. One file may have only integers in that column and the other a decimal or a stray text value. Use Cast Columns on one file so both have the same type, then compare again.

Do the two CSV files need their columns in the same order?

No. Columns are matched by name, not position. A file with sku, product, price compares correctly against one with price, sku, product.

How does the comparison decide two rows are the same?

It uses only the columns that exist in both files with the same name and type, and treats two rows as equal when every one of those values matches. Rows only in A are found with a set difference, and rows in both with a set intersection. A changed value makes the row appear once in each Only set.

What happens to duplicate rows?

Each result set lists distinct rows. If a row appears three times in File A and never in File B, it appears once in Only in A. Use Find Duplicates first if the number of copies matters.

Can I match rows on a key column and see which fields changed?

No. The tool compares whole rows, not rows joined on an ID. To see field-level changes, load both files in the SQL workspace and join them on the key column.

Related Tools