99tools

Text Diff

runs in your browser

Compare two pieces of text side by side or as a unified list, by line, word or character, with options to ignore whitespace and case.

Compare by
View

Original

Changed

Differences

Paste text into both panes to compare them.

about this tool

Comparing two versions

Paste the old text on the left and the new on the right. Changed lines are marked with a symbol as well as a colour, so the result still reads if you are colour-blind or printing in black and white.

Split view puts the two versions side by side, which is the clearer choice when lines have been rewritten. Unified stacks them into a single column like a patch, which is easier to read on a phone and easier to paste into a comment.

For two JSON documents, the JSON diff compares the parsed data instead, so reordered keys and reformatting do not show up as changes.

Choosing the granularity

Line is the default and the right answer for code, configuration and CSV. It reports whole lines as added or removed.

Word is for prose. Change one word in a long paragraph and a line diff reports the entire paragraph as replaced, telling you nothing; a word diff points at the word.

Character is for the cases where a word diff still says "these are different" without saying how — a swapped digit in an ID, a homoglyph pasted from a document, a missing hyphen.

Ignoring noise

Ignore whitespace collapses runs of spaces and drops leading and trailing space, so a file reindented from tabs to spaces stops reporting every line as changed. Ignore case does the same for capitalisation. Both are worth reaching for when the real change is buried in formatting churn.

Line endings, the usual culprit

If two files look identical but every line reports as changed, the cause is almost always line endings: one file uses Windows \r\n and the other Unix \n. Turning on ignore whitespace makes the real differences visible. Invisible characters are the other candidate — a non-breaking space pasted from a web page or a document looks exactly like a normal space and is not one. A character-level diff will show you where.

Why do this in the browser

A diff is often the most sensitive thing you handle in a day: two versions of a contract, a config file with credentials in it, a patient list before and after an edit. Both texts stay in the page and neither is uploaded, so there is nothing to think about before pasting.

questions

Why does every line show as changed when the files look identical?
Almost always line endings: one file uses Windows carriage returns and the other Unix newlines. Turn on ignore whitespace and the real differences appear. Invisible characters such as a non-breaking space pasted from a web page are the other common cause.
Should I use a line, word or character diff?
Line for code, config and CSV. Word for prose, because changing one word makes a line diff report the whole paragraph as replaced. Character for the last mile — a swapped digit in an ID or a missing hyphen.
Is my text uploaded to compare it?
No. Both versions stay in the page and the comparison runs in your browser. That matters because diffs are often the most sensitive thing you handle: two drafts of a contract, or a config file containing credentials.
What is the difference between split and unified view?
Split shows the two versions side by side, which is clearer when lines have been rewritten. Unified stacks them into one column like a patch file, which reads better on a narrow screen and pastes into a comment.
Can I see the difference without relying on colour?
Yes. Every changed row carries a symbol as well as a colour, so the output still reads if you are colour-blind or printing in black and white.