Skip to content
AZ Tools

Text Diff Viewer

Compare two pieces of text and see line-by-line or word-by-word additions and removals.

+ 0− 0
Diff

No differences detected.

How to use

  1. Paste the original text on the left, the new version on the right.
  2. Choose line-mode for code/configs, word-mode for prose.
  3. Toggle 'ignore whitespace' if formatting changed but content didn't.
  4. Read the inline diff and added / removed counts.

About this tool

Show

Compare two blocks of text and see exactly what changed, with additions and deletions marked inline. The choice of mode is the whole trick. Line mode is what you want for code, config and logs, where a line is the unit that means something, and it can ignore whitespace so a re-indented block does not drown the real change. Word mode compares within the line, which is what prose needs: reflow a paragraph and a line-based diff will mark every line as changed even though one word moved, while word mode points straight at the word. Whitespace is compared as part of the text in word mode, so a doubled space or a switched-out non-breaking space shows up rather than hiding. Nothing is uploaded — both texts stay in the page.

Frequently asked questions

Is the diff stored anywhere?

No. Diffing happens locally with the 'diff' library — neither side of the text leaves your browser.

Word vs line mode?

Line mode shows full lines as add/remove blocks — best for source code, JSON, config files. Word mode highlights individual word changes within a paragraph — best for prose, docs, captions.

What does 'ignore whitespace' do?

In line mode, it treats lines as equal if they differ only by leading/trailing spaces or tabs. Useful when comparing reformatted code.

How big can the inputs be?

Tens of thousands of lines work, but the diff is O(n²) so very large files will get slow. For huge files, prefer 'git diff' or a desktop tool.

A reformatted paragraph shows as entirely changed. What should I use?

Word mode. Reflowing a paragraph moves the line breaks, and a line-based diff can only report that every line differs — technically true and useless. Word mode compares inside the lines and points at the words that actually moved, which is what prose review needs.

Two lines look identical but are marked as different.

Something invisible differs: a trailing space, a tab where spaces were, a non-breaking space pasted from a web page, or a CRLF line ending against an LF one. Ignore-whitespace in line mode hides the first three. For the line endings, the line-endings converter is the tool that shows you which is which.

Guides on this topic

Related tools