Text Diff Checker

Compare two texts and highlight the differences.

+0 additions −0 removals

Paste text into both boxes to see the differences highlighted here.

Free online text diff checker

This text diff checker compares two blocks of text and highlights exactly what changed between them. Paste an original version on the left and an edited version on the right, and every added, removed, and unchanged line is colour-coded instantly. It is ideal for spotting edits between two drafts of an article, comparing configuration files, reviewing code snippets, or checking what a colleague altered in a contract. The comparison is a literal line-by-line comparison, so each line is matched as a whole unit rather than word by word.

How to compare two texts

  1. Paste or type the first version into the Original box.
  2. Paste the second version into the Changed box.
  3. Read the highlighted result: removed lines appear in red with a minus marker, added lines appear in green with a plus marker, and unchanged lines stay plain.
  4. Check the summary counts, then click Copy diff to grab a plain-text version.

How the diff is calculated

Under the hood the tool splits both inputs into arrays of lines and builds a Longest Common Subsequence (LCS) dynamic-programming table. Backtracking through that table produces the minimal sequence of keep, add, and remove operations — the same core technique that powers git diff and other version-control tools. Because it works on whole lines, a single changed character shows the old line as removed and the new line as added. To tidy inconsistent spacing before comparing, try the Remove Line Breaks tool, or count the length of each version with the Word Counter.

Private and browser-based

Every comparison runs locally in your browser — nothing you paste is ever uploaded — so you can safely diff confidential code, documents, or data with no sign-up and no limits.

Frequently asked questions

How does the text diff checker work?

Paste your original text on the left and the changed text on the right. The tool splits both into lines and uses a Longest Common Subsequence (LCS) algorithm to find the longest run of matching lines, then marks everything else as an addition or a removal. The comparison updates live as you type, entirely in your browser.

Is the comparison line-by-line or character-by-character?

This is a literal line-by-line comparison. Each line is compared as a whole unit, so a single changed character makes the whole line show up as one removed line and one added line. That keeps the output easy to scan and mirrors how tools like git diff present changes.

What do the colors and markers mean?

Lines with a red (danger) background and a minus (−) marker exist only in the original text — they were removed. Lines with a green (success) background and a plus (+) marker exist only in the changed text — they were added. Lines with no highlight are unchanged and appear in both texts.

Is my text uploaded to a server?

No. The entire diff is computed locally in your browser with JavaScript. Nothing you paste is uploaded, stored, or logged, so it is safe to compare private code, contracts, or confidential documents.

Does whitespace and trailing spaces affect the diff?

Yes. Lines are compared exactly, including leading and trailing spaces and tabs, so two lines that look identical but differ in whitespace are treated as different. If you want to ignore stray whitespace, clean up your text first with a whitespace remover before comparing.