Staaarter

CSV Differ

Produces a unified-diff-style, line-level comparison of two raw CSV texts using an LCS-based line alignment: unchanged lines are shown unmarked, removed lines are prefixed with '-', and added lines are prefixed with '+'. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
multi-filecomparison

Overview

Introduction

When you just want to see what changed between two CSV files the way `git diff` or `diff -u` would show it, a structured cell-by-cell report is more than you need. This tool gives you a familiar unified line diff instead.

It treats the CSV as plain text lines, which makes it fast and immediately readable for anyone used to reading code diffs.

What Is CSV Differ?

A line-level, unified-diff-style comparator for two raw CSV texts: unchanged lines are unmarked, lines only in the first text are prefixed '-', and lines only in the second are prefixed '+'.

It's the text-diff counterpart to CSV Comparator's structured, parsed cell-level summary.

How CSV Differ Works

Both inputs are split into lines on newline boundaries. A longest-common-subsequence table is built between the two line arrays, then the table is walked to produce the minimal edit script of matched, removed, and added lines.

The result is printed with the classic '-'/'+'/unmarked-line convention, one line of output per line of input.

When To Use CSV Differ

Use it when you want a quick, readable, code-review-style view of what changed between two CSV versions.

It's a good first pass before reaching for CSV Comparator's structured cell-level report on the same two files.

Often used alongside CSV Comparator and CSV File Merger.

Features

Advantages

  • Familiar unified-diff format that's immediately readable to anyone who has used `diff` or `git diff`.
  • Fast and simple: no CSV parsing is required, just line-level LCS alignment.
  • Runs entirely client-side, so neither file ever leaves your browser.

Limitations

  • It's text-only: quoted CSV fields containing embedded newlines will be split across multiple diff lines rather than treated as one logical row.
  • The O(n*m) LCS table can get slow on very large files (many thousands of lines); it's intended for hand-sized CSVs.

Examples

Diffing two versions of a small CSV

Input

A:
id,name
1,Ada
2,Alan

B:
id,name
1,Ada
2,Al
3,Grace

Output

  id,name
  1,Ada
- 2,Alan
+ 2,Al
+ 3,Grace

The header and first row are unchanged; row 2 changed (shown as a removed old line and an added new line), and a new row 3 was appended.

Best Practices & Notes

Best Practices

  • Reach for CSV Comparator instead if you need the changed cell's exact (row, column) coordinate rather than a raw line diff.
  • Be aware that any quoted, multi-line field will produce a noisy-looking diff, since this tool only understands line boundaries, not CSV quoting.
  • Diff files with the same line-ending style (both LF or both CRLF) for the cleanest results.

Developer Notes

The LCS table is built once for the whole pair of files (O(n*m) time and space), then walked once to emit the edit script - this is the standard approach and is simple to reason about, at the cost of being unsuitable for very large inputs where a streaming Myers-diff variant would scale better.

CSV Differ Use Cases

  • Getting a quick, familiar diff view of what changed between two CSV exports
  • Reviewing a teammate's manual edits to a shared CSV in a code-review-like format
  • Spotting exactly which rows were added, removed, or modified between two versions

Common Mistakes

  • Expecting quoted multi-line CSV fields to diff as one row; they're split by physical line instead.
  • Confusing this tool's raw text diff with CSV Comparator's structured, cell-coordinate-based summary - they answer different questions.

Tips

  • If the diff looks unexpectedly noisy, check whether one file uses CRLF line endings and the other LF.
  • Follow up with CSV Comparator when you need to know the exact column a changed value lives in.

References

Frequently Asked Questions