Text Diff Checker

Paste two blocks of text to compare them side by side. Differences are highlighted line by line. All processing happens locally in your browser.

Copied!
  Added   Removed   Unchanged

About Text Diff

This tool compares two texts line by line and highlights differences. Green lines are additions found only in the modified text. Red lines are deletions found only in the original text. Grey lines are unchanged.

Comparing whole lines answers most questions, but a line that changed by one word repaints entirely, so the word setting runs a second pass inside each changed pair and marks only the parts that moved. The unified view produces the same shape as a patch file, hunk headers included, which is what you want when the result is going into a code review rather than onto a screen. Ignoring spacing, case or blank lines all work by comparing normalised copies, so the output still shows the lines as you actually wrote them.

Is the markup fighting you?

Escaped entities, mangled encodings and content that renders one way in the CMS and another on the page usually mean something in the pipeline is guessing. We build front ends and the publishing path behind them, so what you write is what a visitor sees.

Talk to us about your site

Frequently Asked Questions

Why does a line I only edited slightly show as fully removed and added?
Because a line diff has no smaller unit than a line: any change makes the old one a deletion and the new one an addition. Switch the comparison to words and the page runs a second pass inside each changed pair, marking only the parts that actually moved.
What is the unified view for?
It is the format a patch file uses, with @@ headers giving the line numbers on each side. Copy it into a code review, a bug report or `git apply` and it behaves the way anyone reading it expects, which a coloured screen does not.
Why did it refuse to compare my two files?
A line by line comparison costs one step per pair of lines, so two very large files run into the millions. The page trims the shared beginning and end first, which usually solves it, and stops rather than freezing the tab when what is left is still too big. Cut down to the section you care about.
What do the ignore options actually ignore?
They compare normalised copies of each line while still showing you the original. Ignoring spacing collapses runs of spaces and tabs, which is what you want when an editor has reindented a file. Ignoring case is for comparing configuration keys and headers.
Are my two documents uploaded?
No. The comparison runs entirely in your browser, so nothing is sent anywhere. That matters here more than on most tools, because the things people diff are usually two versions of a config file or a contract.