Text Diff & Compare

Free online text diff tool. Compare two texts in line, character or word mode with side-by-side or unified views, and live added/removed/unchanged counts. Runs entirely in your browser.

Runs locally · data never uploaded
Advertisement

How to use

What it does

A text diff finds the differences between two pieces of text. This tool supports three granularities: line (split on newlines, great for code and prose), character (per-character, for small edits) and word (split on words, great for natural language). The view can be side-by-side (original on the left, changes on the right) or unified (stacked with -/+ markers). Every comparison reports the added, removed and unchanged counts.

Example

Paste the original on the left and the changed version on the right:

function add(a, b) {
  return a + b;
}
function add(a, b) {
  // sum
  return a + b;
}

Pick "Line + Side-by-side" and the new comment line is highlighted in green while the rest stays unchanged.

Use cases

  • Spot exactly which lines a colleague changed during code review
  • Compare two versions of a config, log or translation
  • Review copy edits across document revisions

All computation happens in your browser, and it keeps working offline.

FAQ

Q1.What is the difference between side-by-side and unified?
Side-by-side puts the original in the left column and changes in the right, aligning deletions and additions — ideal for large texts. Unified stacks everything with -/+ markers, which is more compact for quick scanning.
Q2.When should I use word vs character mode?
Use word mode for English docs and translations where words are natural units. Chinese or whitespace-free text has no word boundaries, so character mode gives finer differences. Code usually uses line mode.
Q3.Is my text uploaded?
No. The diff is computed entirely in JavaScript inside your browser. No network request ever carries your text, and the tool works offline.
Q4.Does it handle very large text?
It handles large text well, though character mode on millions of characters can be a little slower. Typical code and documents finish in milliseconds.
Advertisement

Related tools