± Text Diff Checker

Compare two blocks of text side by side and see differences highlighted. Line-by-line and word-level diff view. Free online text diff tool — no signup, works in browser.

How to Use

1

Paste your texts

Paste the original text in the left box and the modified text in the right box.

2

Click Compare

Press Compare to instantly highlight all additions, deletions, and unchanged lines.

3

Read the results

Green lines are additions, red lines are deletions, grey lines are unchanged.

Frequently Asked Questions

How does the diff checker work? +
The tool compares your two texts line by line. Lines only in the first text are shown in red (removed), lines only in the second text are shown in green (added), and matching lines are shown in grey (unchanged).
Can I compare code files? +
Yes. Paste any code, configuration files, JSON, SQL, or plain text. The tool highlights exactly which lines changed.
What does "ignore whitespace" do? +
When enabled, lines that differ only in leading/trailing spaces or tabs are treated as equal. Useful when comparing code that was reformatted.
Is there a size limit? +
There is no hard limit, but very large texts (100,000+ lines) may be slow since all processing happens in your browser.
Is my text sent to a server? +
No. The entire comparison is done in JavaScript in your browser. Your text never leaves your device.


Complete Guide: Text Diff Tool

A diff tool compares two versions of text and highlights what has changed — additions, deletions, and modifications. Whether you're reviewing a colleague's edits to a document, debugging a configuration change, or proofreading a legal contract, a well-designed diff view makes changes immediately visible.

Diff Granularity: Line, Word, and Character

Diff algorithms operate at different levels of granularity, each suited to different use cases:

The Myers Diff Algorithm

The most widely used diff algorithm is the Myers algorithm, published by Eugene Myers in 1986. It finds the shortest edit script — the minimum number of insertions and deletions needed to transform one text into another. It runs in O(ND) time, where N is the total length of both texts and D is the number of differences.

The Myers algorithm is used by git diff, GNU diff, and most diff libraries. Its output is the standard unified diff format:

--- original.txt
+++ modified.txt
@@ -1,4 +1,4 @@
 This line is unchanged.
-This line was removed.
+This line was added.
 Another unchanged line.

Levenshtein Distance for Fuzzy Matching

Levenshtein distance measures how many single-character edits (insertions, deletions, substitutions) are needed to change one string into another. Unlike Myers (which aligns sequences), Levenshtein gives a numerical similarity score useful for fuzzy matching — finding near-duplicate lines that have been partially reworded. A Levenshtein distance of 0 means identical; lower numbers mean more similar.

Ignoring Whitespace

When reviewing reformatted code or documents where only indentation changed, whitespace-ignoring diffs are invaluable. In git diff, use -w to ignore all whitespace changes or --ignore-space-change (-b) to ignore changes in the amount of whitespace:

git diff -w HEAD~1 HEAD -- config.json

Use Cases

Programmatic Diffing in Node.js

The diff npm package provides Myers-algorithm diffing for JavaScript with multiple granularity modes:

const Diff = require('diff');

const one = 'The quick brown fox';
const two = 'The fast brown dog';

const changes = Diff.diffWords(one, two);
changes.forEach(part => {
  if (part.added) process.stdout.write('\x1b[32m' + part.value + '\x1b[0m');
  else if (part.removed) process.stdout.write('\x1b[31m' + part.value + '\x1b[0m');
  else process.stdout.write(part.value);
});
🧰 50+ Tools