Diff Checker

Compare two texts and see exactly what moved, line by line or word by word.

Original
Changed
Difference
Send output to

Finding the smallest honest explanation of a change

Comparing two versions of a file is easy to do badly. Line up the two texts and mark every line that differs, and a single inserted line at the top makes the entire rest of the file look changed. What you want is the shortest edit script: the smallest set of insertions and deletions that turns one text into the other.

That is what the Myers algorithm computes, and it is what Git uses. This tool implements the same approach, which is why the output tends to agree with your intuition about what actually moved.

Line diff or word diff

Line granularity is right for code, where a line is the natural unit and you want to see which statements changed. Word granularity is right for prose, and for anything that lives on one very long line — a minified bundle, a single-line JSON payload, a log entry. A line diff of those says only "this line changed", which you already knew.

Normalise before you compare

Most confusing diffs are comparing formatting rather than content. Two JSON documents with identical data but different indentation produce a diff that touches every line. The fix is to normalise both sides first — which is why every formatter on this site can hand its output straight to this tool. Format both payloads, send each here, and the diff is between the data rather than between two people's editor settings.

The ignore whitespace option handles the milder version of the same problem: trailing spaces, and indentation changes that carry no meaning.

Both sides stay on your machine

Diffing is something people reach for with configuration files, contracts, log excerpts and database dumps — material that often should not be pasted into a stranger's server. Nothing here is transmitted.

Questions people actually ask

Which diff algorithm is used?
Myers, the same algorithm Git uses. It finds the shortest edit script, which is why the output tends to match your intuition about what actually changed rather than flagging half the file.
When should I use word diff instead of line diff?
Line diff suits code, where a changed line is the unit you care about. Word diff suits prose and long single-line content such as minified JSON, where a line-level view would just say the one line changed.
Can I compare formatted output from another tool?
Yes — that is the main reason it exists here. Format two JSON payloads, send each into this tool, and the diff is between the normalised versions rather than between two different indentation styles.
navigate open esc close