Skip to content
Developer

Diff Checker

Compare two texts line-by-line with a color-coded LCS diff.

diffcomparetextlcschanges
Loading tool…

Recommended tools

Affiliate links — we may earn a commission if you sign up.

About the Diff Checker

The Diff Checker compares two versions of text line by line using a dynamic-programming LCS implementation, and shows you exactly what was added, removed, and kept. Paste the original into the left textarea and the modified version into the right — both show live line counts — and the comparison recalculates on every keystroke. A color-coded visual panel renders the result in the familiar diff style: green lines for additions, red lines for removals, and gray lines for unchanged context, each prefixed with +, -, or a space. Two switches tune the comparison: Ignore whitespace strips all spacing before matching, and Ignore case lowercases every line, and when the inputs are identical under the active options a No differences badge appears so a clean comparison is never ambiguous. The Unified diff panel below emits standards-compliant patch format with --- original / +++ modified headers, @@ hunk markers, and three lines of context, ready to download as diff.patch. Whether you are reviewing an edited config file, comparing two pasted versions of a contract, or preparing a patch for review, this is the tool for the job.

Hand-written guide

Examples

Input
Original: The quick brown fox
jumps over the lazy dog.
Line three is here.
A line that will be removed.
Line five stays.
The end.

Modified: The quick brown fox
jumps over the lazy dog.
Line three is here.
A brand new line was added.
Line five stays.
The end.
Output
--- original
+++ modified
@@ -1,6 +1,6 @@
 The quick brown fox
 jumps over the lazy dog.
 Line three is here.
-A line that will be removed.
+A brand new line was added.
 Line five stays.
 The end.
Note: The built-in sample pair — one line removed, one added, with three lines of context in the unified hunk.
Input
Original: const x = 1;
Modified: const x=1;
(Ignore whitespace on)
Output
--- original
+++ modified
Note: With Ignore whitespace enabled the spacing difference disappears, the unified view shows only headers, and the No differences badge appears.
Input
Original: SELECT id
Modified: select id
(default options)
Output
--- original
+++ modified
@@ -1,1 +1,1 @@
-SELECT id
+select id
Note: By default case matters, so the lowercase edit is flagged; flipping Ignore case makes the same pair identical.

How to use

  1. 1

    Paste the earlier version into the Original textarea and the new one into Modified.

  2. 2

    Watch the Added, Removed, and Unchanged stats update as you type.

  3. 3

    Toggle Ignore whitespace or Ignore case if you want those differences suppressed.

  4. 4

    Read the Visual diff card — green added, red removed, gray context.

  5. 5

    Download the Unified diff as diff.patch from the result box.

Common use cases

  • Comparing two pasted versions of a config file after an edit.
  • Reviewing a contract or document revision for insertions and deletions.
  • Checking whether two code blocks differ only in formatting.
  • Preparing a patch-style summary of changes for a code review comment.
  • Verifying a hand-merged file against the original side by side.
  • Auditing what an automated tool changed in a generated file.

Best practices

  • Compare whole lines for structure-level review — the line-based LCS aligns moved lines properly.
  • Turn on Ignore whitespace when checking reformatted files so indentation noise does not bury real changes.
  • Use Ignore case for keyword case-insensitive formats, but keep it off when case is meaningful.
  • Read the stats first: if Added and Removed are zero, you are looking at identical inputs.
  • Treat the unified output as a report, not a patch file for git apply — headers are generic.
  • Load sample first to internalize the green/red/gray scheme before pasting large documents.

Tips

  • Toggle Ignore whitespace before comparing minified versus pretty-printed code.
  • Read the green and red lines top to bottom — the visual card is often clearer than the patch text.
  • When both switches are on and differences remain, those edits are real and worth reviewing.
  • Download diff.patch as an attachment to a review so reviewers see the exact hunk context.

Frequently asked questions

Text Diff adds word and character granularities plus a unified output with different headers, while Diff Checker is a dedicated line-by-line comparison with its own visual card. Both use LCS matching, but this tool keeps the workflow focused on whole lines.

Explore more developer tools

Browse the full collection of developer tools on the hub, or jump back to all categories.