Diff Checker

Compare two texts and see exactly what changed. Line-by-line diff with word-level highlighting, added/removed stats, and options to ignore whitespace or case. Runs 100% in your browser — no data uploaded.

Did we solve your problem today?

What Is a Text Diff Checker?

A text diff checker takes two pieces of text — an original and a modified version — and computes exactly what changed between them. Changed lines are highlighted in color: green for lines that were added, red for lines that were removed, and gray for lines that stayed the same. This makes it immediately obvious which parts of a document changed without having to read every word manually.

This tool runs the Myers diff algorithm entirely in your browser. Nothing is sent to a server. Paste both texts, click Compare, and see the result instantly.

How to Use the Diff Checker

  1. Paste the original text into the left panel.
  2. Paste the modified text into the right panel.
  3. Click Compare (or press Ctrl+Enter).
  4. Read the diff output below: green lines are additions, red lines are removals, gray lines are unchanged.

The stats bar shows the total count of added and removed lines at a glance.

Options

Ignore Whitespace

When active, leading and trailing spaces and tabs are removed from each line before comparison. Two lines that differ only in indentation or trailing spaces are treated as equal. Enable this when comparing code that has been reformatted, or when text from different sources uses inconsistent spacing.

Ignore Case

When active, uppercase and lowercase letters are treated as the same character. “Hello” and “HELLO” are considered identical lines. Useful when comparing SQL queries written in different case conventions, or configuration files where key names may have been uppercased.

Word Diff

When active, the diff goes one level deeper: instead of only marking full lines as added or removed, it also highlights the specific words within a changed line that differ. This is helpful for spotting small edits inside long sentences — for example, a single noun that was replaced in a paragraph.

What the Myers Algorithm Does

The diff is computed using the Myers diff algorithm, introduced by Eugene Myers in 1986. It finds the shortest edit script — the fewest number of line insertions and deletions needed to transform text A into text B.

Internally, the algorithm works on a two-dimensional edit graph where each horizontal step represents deleting a line from text A, each vertical step represents inserting a line from text B, and diagonal steps represent matching equal lines. The algorithm finds the shortest path through this graph, which corresponds to the fewest edits.

This is the same algorithm used by Git, GNU diff, and most professional code review tools. It guarantees an optimal diff — no unnecessary edits are introduced.

Reading the Diff Output

ColorMeaning
Green backgroundLine exists in the right panel (new text) but not in the left (original)
Red backgroundLine exists in the left panel (original) but not in the right (new text)
Gray / neutralLine is the same in both texts

Line numbers are shown on each side independently: the left column shows the line number in the original text, the right column shows the line number in the modified text. Removed lines show no right-side number; added lines show no left-side number.

Common Use Cases

Code review: Paste the old version of a function and the new version to see exactly what changed before committing.

Document editing: Compare two drafts of a document — a contract, a README, a specification — to audit all revisions.

Configuration files: Diff two config files to find which settings were added, removed, or changed between environments.

Data validation: Compare two exported CSV or JSON snippets to verify that a data transformation produced the expected output.

Translation review: Compare two translations side by side to find additions, omissions, or alterations in the translated text.

Privacy

All processing happens locally in your browser using JavaScript. The texts you paste are never transmitted to any server, logged, stored, or processed externally. Closing or refreshing the page clears both input panels completely.

Statistics

After each comparison, the tool reports:

These counts reflect the raw line diff, not word or character counts. A single line that changed completely counts as one removal and one addition.

FAQ

Is my text uploaded to a server?

No. All comparison runs locally in your browser using JavaScript. Your text never leaves your device.

What diff algorithm does this use?

The tool uses the Myers diff algorithm, the same algorithm used by Git. It finds the shortest edit script (fewest additions and removals) that transforms one text into the other.

What does "ignore whitespace" do?

When enabled, leading and trailing whitespace is stripped from each line before comparison. Lines that differ only in indentation or trailing spaces are treated as equal.

What does "ignore case" do?

When enabled, the comparison is case-insensitive. "Hello" and "hello" are treated as the same line.

What is word-level diff?

For lines that were modified (rather than completely added or removed), the tool highlights which individual words changed within the line — making it easier to spot small edits.