Z

Diff Checker

Compare two blocks of text and highlight the differences line by line.

Runs in your browser — files never leave your device

Original
Changed

How it works

Paste the original text on the left and the changed version on the right, and the tool recomputes the comparison on every keystroke. Both inputs are split into lines, and a longest-common-subsequence (LCS) algorithm — the same family of algorithm behind the classic Unix diff command — finds the largest set of lines the two versions share in order. Everything outside that shared skeleton is reported: lines that exist only in the original are marked removed with a - prefix on a red background, and lines that exist only in the changed version are marked added with + on green.

The comparison is exact. Two lines match only when they are identical character for character, so the diff is case-sensitive and whitespace-sensitive — a trailing space, a tab swapped for spaces, or Hello versus hello is enough to flag a line. Because matching is line-level, an edited line shows up as a pair: the old version as a removal directly above the new version as an addition. There is no word-level highlighting inside a line, and when the alignment is ambiguous the algorithm prefers to report the removal first.

A concrete example: compare a three-line original alpha / beta / gamma against a changed version reading alpha, beta two, gamma, delta. The result lists alpha unchanged, then - beta and + beta two, gamma unchanged, and finally + delta — one line removed, two added, two untouched.

Typical uses: reviewing a code snippet outside version control, comparing two versions of a config or .env file before deploying, spotting exactly what an editor or formatter changed, checking two drafts of copy against each other, and verifying that generated output — SQL, CSV, JSON — matches what you expected.

Two gotchas. Reordered blocks are not detected as moves: a paragraph that moved down reads as a removal in one place and an addition in another, even though the text is unchanged. And because the algorithm may compare every line pair, inputs of tens of thousands of lines can get slow — the tool is designed for snippets and typical documents.

Frequently asked questions

What granularity does the diff use?
The comparison is line by line. An edited line appears as two rows — the old line as a removal and the new line as an addition — and there is no character- or word-level highlighting within a line. If you need finer detail, split long lines before comparing.
Is the comparison case- and whitespace-sensitive?
Yes. Lines match only when they are identical character for character, so Hello and hello count as different lines, and an invisible trailing space is enough to mark a line as changed. Comparing "hello " against "hello" produces one removed and one added line.
What algorithm does it use?
A longest-common-subsequence (LCS) diff computed with dynamic programming — the same approach classic line-diff tools are built on. It reports the minimum number of added and removed lines needed to turn the original into the changed version, and when both orderings are possible it lists a removal before an addition.
Does it detect moved lines?
No. A block that moved shows up as removed from its old position and added at its new one, like most line diffs. The line content being identical in both rows is the clue that text was moved rather than rewritten.
How large can the inputs be?
Snippets and typical documents compare instantly on each keystroke. The algorithm may compare every line of one side against every line of the other, so inputs with tens of thousands of lines each can make the page noticeably slow.
Is my text uploaded?
No — both texts stay in your browser and the diff is computed locally on your device. Nothing is sent to a server or stored.