Text Diff Checker

Paste two versions of text or code and see every line and word that changed, entirely in your browser.

Diff mode
Layout
Syntax highlighting

How to use

  1. Paste the original version on the left and the changed version on the right.
  2. Choose Line diff (default) or Word diff for the whole document.
  3. Pick a language to highlight code, or leave it on Auto-detect.
  4. Added lines/words are green, removed are red; a changed line also shows exactly which words changed.
  5. Read it Side by side (old and new aligned, each with its own line numbers) or Unified, and step through the changes with the ↑ ↓ buttons.

Two ways to compare, because "changed" means different things

A config file or source code has meaningful line structure: which line something is on is part of what changed. Prose usually does not: a paragraph can be rewrapped at a different width with zero real edits. Line diff serves the first case, and inline-highlights the exact word inside a changed line rather than just marking the whole line different. Word diff serves the second case by ignoring line breaks altogether.

Example

Line diff on a single changed word:

- The quick brown fox jumps.
+ The quick red fox jumps.
  Second line.

Word diff correctly ignoring a rewrapped paragraph with no real edits (0 words changed):

The quick brown
fox jumps over
the lazy dog.
->
The quick brown fox
jumps over the
lazy dog.

Options explained

Edge cases and common errors

Do the same thing in code

# Python: a quick line diff using the standard library
import difflib
diff = difflib.unified_diff(a.splitlines(), b.splitlines())
print('\n'.join(diff))

Comparing two JSON documents instead of plain text? A line diff will flag a reordered key as a change even though nothing meaningful is different; the JSON Diff Checkercompares by key path instead, so that never happens.

Text Diff Checker FAQ

What is the difference between line diff and word diff?

Line diff (the default) compares the two texts line by line: an unchanged line shows plain, a changed line shows removed and added versions with the specific changed word or words highlighted inside them (in this page's own worked example, only "brown" and "red" are highlighted, not the whole line). Word diff instead compares the whole document word by word, ignoring line breaks entirely, which matters for prose: reflowing a paragraph to a different width changes where the line breaks fall without changing a single word, and line diff would show that as a wall of red and green even though nothing was actually edited.

Does word diff get confused by a paragraph that was just rewrapped, with no real edits?

No, by design. This exact case, "The quick brown / fox jumps over / the lazy dog." reflowed as "The quick brown fox / jumps over the / lazy dog.", contains only different line breaks, no changed words, and word diff correctly reports 0 words changed. Line breaks and single spaces are treated as interchangeable for word diff specifically; an actual blank line inserted between paragraphs is still detected, since that is a real structural change, not just rewrapping.

How good is the syntax highlighting?

Basic and deliberately so: keywords, strings, comments and numbers for JavaScript/TypeScript, Python, JSON, HTML/XML, CSS, SQL and Bash, detected from simple patterns rather than a full parser. Auto-detect guessed "javascript" for a short JavaScript snippet correctly, but it is a heuristic, not a certainty; pick the language yourself if it guesses wrong. On a line with an inline word-level change, the word-diff colors take over from syntax colors for that line, since highlighting what changed matters more there than what kind of token it is.

Is there a size limit?

Yes: 5,000 lines per side for line diff, or 20,000 words per side for word diff. Past that, the message is "Each side is limited to 5,000 lines for line diff; this input has more." (line diff) or "Each side is limited to 20,000 words for word diff; this input has more." (word diff), rather than freezing the tab: the underlying algorithm's running time grows with how different the two texts are, and a genuinely huge, completely unrelated pair of documents could otherwise lock up the page.

Does anything get uploaded?

No. Both texts are compared entirely in your browser; this page is a static file with no server behind it, so neither version is ever sent anywhere.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta.