Diff Checker

Compare text differences


          

What Is This Tool?

The Diff Checker compares two blocks of text line by line and highlights what was added and removed between them, using a longest common subsequence (LCS) algorithm — the same technique behind most source-control diff tools. Everything is computed locally in your browser.

How to Use

1

Paste your original text into the left box.

2

Paste the modified text into the right box.

3

Click Compare to see the line-by-line diff.

4

Added lines are highlighted green, removed lines red.

Features

  • Real LCS-based line diff, not a naive index comparison
  • Added and removed lines clearly color-coded
  • Counts of added and removed lines
  • Copy result as a unified-diff-style text with +/- prefixes
  • Guards against pathologically long input to keep the tab responsive
  • 100% client-side — nothing leaves your browser

Examples

Original:

The quick brown fox
jumps over the lazy dog
The end.

Modified:

The quick brown fox
jumps over the sleepy dog
The very end.

The diff highlights that "lazy" changed to "sleepy" and "The end." changed to "The very end." as removed/added line pairs, while the first line stays unchanged.

Common Use Cases

  • Reviewing changes between two versions of a config file or document
  • Comparing two drafts of an email or article
  • Spotting accidental edits between two pasted code snippets
  • Checking what changed in a data export between runs

Frequently Asked Questions

Is my text uploaded anywhere?

No. The comparison runs entirely in your browser using JavaScript. Nothing is sent to a server.

How does the diff algorithm work?

It splits both texts into lines and computes the longest common subsequence (LCS) between them using dynamic programming, then walks that result backward to determine which lines were added, removed, or unchanged.

Is there a size limit?

Yes. Texts longer than about 2,000 lines are rejected with a friendly message, since the LCS algorithm's cost grows quickly and very large inputs could freeze the browser tab.

Does it compare word-by-word or line-by-line?

This tool compares line by line. If a single line changes even slightly, the whole line is shown as removed and its replacement as added.

Can I copy the diff result?

Yes, click Copy to get a plain-text version with unchanged lines prefixed by two spaces, added lines by "+ ", and removed lines by "- ".

Is whitespace significant?

Yes, lines are compared exactly as typed, so differing leading/trailing whitespace will show as a difference.