Text Diff Checker

A text diff checker compares two versions of a text and highlights what was added, removed or left unchanged. Paste the original and the changed text below to see every difference by line, word or character.

Reviewed by ToolNook editorial team Updated Sources

Compare by

–

What is a diff checker?

A diff checker compares two pieces of text and shows the differences between them. Writers use it to see what an editor changed, lawyers to compare contract drafts, developers to compare configuration files and code snippets, and students to check revisions of an essay. Finding changes by eye is slow and unreliable, especially when only a word or a comma has moved.

This tool runs entirely in your browser, so you can safely compare confidential documents. Nothing is uploaded or stored.

How to use the text diff tool

  1. Paste the original text on the left and the changed version on the right.
  2. Choose to compare by line (best for code and lists), word (best for prose) or character (best for short strings).
  3. Optionally ignore case or ignore whitespace so formatting-only changes are not flagged.
  4. Review the highlighted result: additions are green, removals are red and struck through. Copy the diff to share it.

How the comparison works

The tool uses the Myers difference algorithm, the same approach behind git diff and many other version control tools. It finds the shortest possible set of insertions and deletions that turns the original into the changed text, which keeps the highlighted changes as small and readable as possible.

In line mode a changed line appears as one removed line followed by one added line. Switch to word mode to see exactly which words within the line changed.

Example

Comparing “jumps over the lazy dog” with “leaps over the lazy dog” by line shows one line removed and one added. Compared by word, only “jumps” is marked as removed and “leaps” as added, while the other words stay unchanged.

More worked examples

Contract edit: comparing two versions of a clause by word shows that only “30 days” changed to “45 days”, even though the whole line looks different by eye.

Common mistakes to avoid

  • Comparing by line for prose. Word mode shows exactly which words changed within long lines.
  • Flagging formatting noise. Tick “ignore whitespace” when indentation or spacing changed.
  • Diffing unformatted JSON. Format both sides first with the JSON formatter so the structure lines up.

Sources and methodology

The calculations on this page follow these published standards and references. The code is covered by automated tests against known values.

Frequently asked questions

Is my text uploaded anywhere?

No. The comparison runs in JavaScript on your device, so private documents never leave your computer.

Can I compare code?

Yes. Line mode works well for source code, configuration files and JSON. For JSON, format both versions with our JSON formatter first so the structure lines up.

What does “ignore whitespace” do?

It treats runs of spaces, tabs and line breaks as a single space and ignores spaces at the ends, so indentation and spacing changes are not reported.

Is there a size limit?

Line comparisons handle long documents. Word and character modes are limited to about 20,000 tokens to keep your browser responsive.