Free Online Text Diff Checker

Paste two pieces of text to instantly compare them line by line. Added lines are highlighted in green, removed lines in red. Line numbers are shown for both sides.

How the Diff Algorithm Works

This tool uses the Longest Common Subsequence (LCS) algorithm — the same core method used by git diff and most professional diff tools. It identifies the largest set of lines that appear in both texts (in order), then marks everything else as either added or removed.

The algorithm runs entirely in your browser. No text is sent to any server.

Reading the Diff Output

Color / SymbolMeaning
🟢 Green / +Line exists in the modified text but not the original (added)
🔴 Red / Line exists in the original text but not the modified (removed)
No color /   Line is the same in both texts (unchanged)

The L column shows the line number in the original (left) text; the R column shows the line number in the modified (right) text.

Common Use Cases

  • Comparing two versions of a configuration file
  • Reviewing edits made to a document or draft
  • Checking what changed between two SQL queries or scripts
  • Comparing API responses before and after a code change
  • Spotting accidental whitespace or invisible character differences

Frequently Asked Questions

Is this a word-level or line-level diff?

This tool performs a line-level diff: it compares the two texts line by line. A line that changed in any way (even one character) will appear as one removed line and one added line. This matches the default behavior of git diff.

Is there a size limit?

There is no hard limit. The LCS algorithm runs in O(m × n) time where m and n are the number of lines. For very large files (tens of thousands of lines), it may take a second or two. All processing is local in your browser.

Is my text kept private?

Yes. Everything runs in your browser. Your text is never uploaded or stored anywhere.