X Xerobit

Text Diff / Diff Checker

Compare two text blocks line-by-line, word-by-word, or character-by-character. Inline highlighting shows added (green) and removed (red) tokens. Ignore whitespace and case when needed. LCS-based diff algorithm.

Diff view
 
Paste text in both sides.

Live Market Insight

DataForSEO · 2026-04-25
Monthly searches (US)
49,500
"text compare"
Cluster volume
91K
diff + compare + text
CPC
$3.56
Top competitor
text-compare.com
4/10 SERPs

Line, word, or character granularity?

Pick based on how similar your two texts are and what you care about:

What's the algorithm?

This tool uses a Longest Common Subsequence (LCS)-based diff. It builds a dynamic-programming table of LCS lengths between the two inputs, then walks back to emit a sequence of keep/add/remove operations. This is essentially the classic Hunt–McIlroy diff that diff -u uses. Runs in O(n×m) time and memory, which is why the tool caps input size at ~2M cells.

For very large inputs (whole-file diffs of 100KB+), professional tools use Myers' variation which runs in O(ND) time (D = edit distance). For typical tool-site use (a few KB max), the straight LCS approach is clearer and fast enough.

Ignore-whitespace and ignore-case

Both options affect comparison only. The displayed tokens keep original casing/whitespace.

Use cases

For structured JSON, use the JSON Diff

If you're comparing JSON, use our JSON Diff instead. It does structural diff — doesn't care about key order or formatting — while this text diff treats the raw characters. Same for comparing config files in YAML: convert both to JSON first, then JSON-diff.

Frequently asked questions

Why does character diff show the whole word changed?

It doesn't — character diff works at the individual-character level. If you see whole words marked, you're probably in Word or Line mode. Switch to Character mode.

Why is it slow on big inputs?

LCS diff is O(n×m). Character-level diff on two 1000-char strings is 1M cells — fine. 10,000 chars each is 100M cells — gets slow and uses a lot of memory. Switch to Word or Line granularity for big inputs.

Is my text uploaded anywhere?

No. Runs entirely in your browser.

Does this handle Unicode correctly?

Yes for BMP characters (including Latin, CJK, most accented). Emoji that use surrogate pairs may be split at character-granularity mode — use word or line mode for emoji-heavy content.

Related tools

Pillar

Part of Data & Format.


Written by Mian Ali Khalid. Last updated 2026-04-25.