Skip to content

Text Diff Checker

Compare two versions of any text line by line. Added and removed lines are colour-coded with line numbers on both sides, changes are counted, and you can copy the result as a unified patch. Options let you ignore whitespace or letter case. Everything runs in your browser.

Runs in your browserFreeNo sign-up

Processed on your device. Files and text stay in your browser and are not uploaded to our servers. How privacy works

How to use the text diff checker

  1. Paste the original text on the left and the changed text on the right. The comparison updates as you type.
  2. Read the coloured result: green lines with + were added, red lines with − were removed, grey lines are unchanged.
  3. Switch on Ignore whitespace to skip indentation and spacing changes, or Ignore case for case-insensitive comparison.
  4. Enable Hide unchanged lines to collapse long identical stretches, then copy or download the unified diff.

Features

  • Myers diff algorithm, the same approach Git uses, so the result is a minimal set of changes
  • Line numbers for both sides, added and removed counts, and an identical-text confirmation
  • Ignore whitespace and ignore case options
  • Collapse unchanged lines with three lines of context, like a code review
  • Unified patch output that git apply and patch understand
  • Handles up to 5,000 lines per side without leaving the browser

How the comparison works

Both texts are split into lines, then a shortest-edit-script search (Myers' algorithm in its linear-space form) finds the smallest number of insertions and deletions that turns the left text into the right one. A changed line therefore shows up as one removed line followed by one added line; there is no character-level highlighting inside a line, which keeps the result unambiguous for code, config files and logs.

Common leading and trailing lines are matched first, so pasting two long files that differ only in the middle is fast.

Reading a unified diff

The copied patch follows the unified format: a --- / +++ header, then hunks introduced by @@ -start,count +start,count @@ that give the line ranges on each side. Lines beginning with a space are context, - lines exist only in the original and + lines only in the changed text. You can save it as a .diff file and apply it with git apply or patch -p0.

Tips

When comparing JSON or code that was reformatted, turn on Ignore whitespace to see only the meaningful changes. For prose, comparing sentence-per-line text gives clearer results than long wrapped paragraphs, because a single edited word otherwise marks the whole paragraph as changed.

Frequently asked questions

Does it show word or character differences within a line?

No, the comparison is line-based: a modified line appears as one removed and one added line. That matches how git diff and most code review tools present changes.

Why is there a 5,000-line limit?

The diff runs on your device, and rendering tens of thousands of coloured rows would make the page sluggish. Split very large files or compare the relevant section.

Are Windows and Unix line endings treated the same?

Yes. CRLF, LF and CR line breaks are all recognised, so a file re-saved on another platform doesn't show every line as changed.

Is my text uploaded?

No. Both texts and the resulting diff exist only in your browser tab.

Other tools people use alongside Text Diff Checker.

You might also like

Something useful from another corner of VoltKit.