FormatterHQ

Compare CSV Files

Compare two CSV files and see exactly which rows were added, removed or changed. Rows are matched by an ID column or by position, and changed cells show the old and new value.

Loading tool…
Ready.

How to use the Compare CSV Files

  1. Add the older file as File A and the newer one as File B: drop each file on its box or paste the CSV.
  2. Keep By key column(s) and tick the column that identifies a row, such as id or email (several columns form a composite key), or choose By row position.
  3. Set the options you need: ignore case, trim spaces, match columns by header name, ignore columns, or a numeric tolerance.
  4. Review the added, removed and changed rows, click the counts to filter them, then copy or download the differences as CSV.

Compare CSV files row by row

When two exports of the same table differ, a line-by-line text diff is rarely helpful: one inserted row or a different column order makes every following line look changed. This tool lets you compare CSV files the way a database would. It matches rows by a key, lines up columns by name, and reports each difference as an added row, a removed row or a changed cell with its old and new value. It runs in your browser, so the files are not uploaded.

Matching rows by key column

Choose the column that identifies a record, such as id, sku or email. The tool suggests the first shared column whose values are unique and non-empty in both files. When one column is not enough, tick several: region + sku together form a composite key. A key found only in file A is removed, a key found only in file B is added, and a key in both files is changed when any compared cell differs.

If a key appears more than once, the rows with that key are paired in the order they appear and a warning tells you how many keys repeat, so you can add another key column. Rows are matched with hash maps, so even files with tens of thousands of rows compare in well under a second on a typical computer.

Matching rows by position

Choose By row position when the files have no ID column and the row order is meaningful: row 2 of file A is compared with row 2 of file B. Extra rows at the end of the longer file are reported as added or removed. An inserted row in the middle shifts everything after it, so use a key when you can.

Example

File A                         File B
id,name,plan,seats             id,plan,name,seats
101,Ava Martinez,Pro,5         101,Pro,Ava Martinez,6
102,Noah Kim,Free,1            103,Team,"Rossi, Mia",12
103,"Rossi, Mia",Team,12       107,Free,Olivia Davis,1

Compared by id, with columns matched by name, the result is: 101 changed (seats 5 → 6), 102 removed, 107 added, and 103 unchanged even though its columns are in a different order.

Options for a fair comparison

  • Match columns by header name lines up columns regardless of their order; names are compared without case and surrounding spaces. Untick it to compare column 1 with column 1. Columns found in only one file are listed and not compared.
  • Ignore case treats “Lucas Brown” and “lucas brown” as equal.
  • Trim spaces (on by default) ignores spaces at the start and end of a cell.
  • Ignore columns skips columns you expect to differ, such as updated_at.
  • Numeric tolerance compares numbers by value: with ±0.01, 120.00 equals 120 and 19.995 equals 20. Numbers written as 1,234.50, $12 or 15% are understood.

Reading the results and exporting the differences

The summary shows how many rows were added, removed, changed and unchanged. Click a count to hide or show that kind of row. Changed cells are shown as old → new, struck through in red and highlighted in green, and long results are split into pages of 200 rows. The CSV export has one row per difference with the columns change, row_a, row_b (row numbers in each file, counting the header), every data column, and changed_columns; changed cells are written as old → new. It contains only the kinds of rows you have selected.

Both files are read with automatic delimiter detection (comma, semicolon, tab or pipe) and encoding detection, so a semicolon export can be compared with a comma one. To compare plain text instead, use the diff checker; for JSON, use JSON diff. To fix the differences you find, open the file in the CSV editor.

Frequently asked questions

Do the two CSV files need the same column order?
No. With "Match columns by header name" ticked, columns are paired by name, so id,name,email and email,id,name compare correctly. Columns that exist in only one file are listed and left out of the comparison.
What if my files have no unique ID column?
Tick several key columns to build a composite key, such as date + store + product. If the row order is meaningful, choose By row position instead.
How are duplicate keys handled?
Rows that share a key are paired in the order they appear in each file, and a warning shows how many keys repeat. Adding another key column usually makes the keys unique.
Can I ignore differences like 10.0 versus 10?
Yes. Tick Numeric tolerance and enter how far apart two numbers may be; 0 compares numbers by value, so 10.0 equals 10. Ignore case and Trim spaces handle text differences.
How big can the CSV files be?
Each file can be up to 100 MB. Rows are matched with hash maps, so tens of thousands of rows compare quickly; the limit in practice is your device memory.
Are my files uploaded?
No. Both files are read and compared in your browser. Save & Share stores only pasted CSV and the options, never the contents of an opened file.

Last updated October 17, 2026

Related tools

Compare PDF Compare the text of two PDFs and see every added, removed and changed sentence side by side. Ignores line breaks. No upload. CSV Editor Online Edit CSV files online like a spreadsheet: change cells, add, move or delete rows and columns, sort, filter, find and replace, undo, then export. CSV to PDF Converter Convert CSV to a printable PDF table: header row on every page, fitted and wrapped columns, A4, Letter or Legal, page numbers. Made in your browser. CSV Viewer View CSV files as a clean, sortable-looking table in your browser. Auto-detects commas, semicolons, pipes and tabs. LaTeX Table Generator Convert CSV, spreadsheet cells or JSON into LaTeX tabular code with captions, labels, borders or booktabs styling. Markdown Table Generator Generate GitHub-flavoured Markdown tables from CSV, TSV, Excel cells or JSON, with column alignment and neat padding. Merge CSV Files Merge several CSV files into one: match columns by header name or position, add the source file name, remove duplicate rows. Runs in your browser. CSV Splitter Split a CSV file every N rows, into equal parts or by the values of a column. The header is kept in every file; download parts or one ZIP. Table to HTML Converter Convert CSV, TSV, Markdown or JSON data into a clean HTML table with optional CSS styling and a live preview. Tableizer: Excel to HTML Table Paste cells copied from Excel or Google Sheets and get a styled HTML table. Choose header colour, font and row striping. Base64 to CSV Decode a Base64 string back to CSV with syntax highlighting. Base64 to TSV Decode a Base64 string back to TSV with syntax highlighting.