Skip to content
Text Diff

Text Diff

Compare two texts with line and word-level highlighting; copy or download a unified diff.

+3 added2 removed
11Privacy-first text tools.
2Runs in your browser.
2+Runs entirely in your browser.
33No sign-up required.
414 tools available.
4+16 tools available.
5+Open source.
56Free forever.

This diff checker compares two versions of a text and shows exactly what changed: line by line, and word by word inside each changed line. Everything runs in your browser, so it works offline and neither text ever leaves your machine. It is handy for reviewing edits to articles, emails, and contracts, comparing two versions of a config or CSV file, or spotting an unexpected change in copied-and-pasted code.

How to use

  1. Paste the first version into the Original panel on the left. The Paste, Sample, and Clear buttons above it save a trip to the keyboard.
  2. Paste the updated version into the Changed panel on the right (it has its own Paste and Clear buttons). If you pasted them the wrong way round, click Swap sides.
  3. Toggle Ignore case or Collapse whitespace if capitalisation or spacing changes should not count as differences.
  4. Read the result: green lines were added, red lines were removed, and the precise words that changed are highlighted inside each modified line. The badges above the diff show running +added/−removed totals.
  5. Click Copy diff or Download to export the comparison as unified-style text.

Line-level vs word-level highlighting

The diff works in two passes. First, a line-level longest-common-subsequence (LCS) algorithm decides which whole lines were added, removed, or kept. Then, wherever a removed line sits next to an added line, a second word-level pass highlights only the tokens that actually differ. For example, comparing Runs in your browser. against Runs entirely in your browser. marks the whole pair as changed lines, but only the word entirely is highlighted, so a one-word edit in a long paragraph is easy to spot. Copying the diff of the built-in sample produces:

 Privacy-first text tools.
-Runs in your browser.
+Runs entirely in your browser.
 No sign-up required.
-14 tools available.
+16 tools available.
+Open source.
 Free forever.

That is the same unified-style format used by git diff and patch: unchanged lines start with a space, removed lines with -, added lines with +. The Download button saves it as diff.patch.

Edge cases and limits

  • Very large inputs: a full LCS comparison grows with the product of both line counts, so after trimming the matching start and end of the two texts, the tool falls back to a simplified comparison (all remaining left lines marked removed, all right lines added) when the middle section is too big. A notice above the diff tells you when this happens.
  • Long lines: word-level highlighting is capped at 400 tokens per line pair; beyond that the whole line is coloured instead.
  • Trailing newlines count as an extra empty line, so an added blank line at the end shows up as a real difference.

FAQ

More questions? Browse the full FAQ.

After reviewing the differences, you may want to apply bulk corrections with the find & replace tool or check how the edit changed your word and character counts.

Search tools

Search all Textbench tools