Skip to main content

Text Diff / Compare

Paste two texts and instantly see additions, deletions and differences — line or word level.

A one-word change, as a diff sees it

Two versions differing only in the final word.

Input
A: the quick brown fox / jumps over the lazy dog
B: the quick brown fox / jumps over the lazy cat
Output
the quick brown fox
−
jumps over the lazy dog
+
jumps over the lazy cat

The shared first line is unmarked, but the changed line appears twice — once − removed, once + added. A diff works in whole lines, so editing one character still deletes and re-inserts an entire line. That is why reformatting a file destroys a diff even when nothing meaningful changed.

What is a text diff?

When you have two versions of the same thing — a draft before and after edits, two config files, two pasted snippets — the fastest way to see what changed is a diff. This text diff tool compares two texts side by side and highlights additions (green) and deletions (red), at either the line or word level. Everything runs locally in your browser, with no upload.

How to use

  1. Paste the "original" and "changed" texts into the two boxes.
  2. The result appears instantly, with a summary of how many lines were added and removed.
  3. Switch to "word" diff to see small in-sentence changes.

Common use cases

  • Compare two versions of code or a config file.
  • See exactly what changed in a contract or piece of copy.
  • Find the differences between two lists. Want to normalize formatting first? Use the text cleaner.

Why does changing one word light up the whole line?

In line diff, a line counts as "changed" if any character differs — so it shows as a red line plus a green line (old removed, new added) even if you only changed one word. That's not a bug; it's the definition of line-level comparison. To see exactly which word changed in a sentence, switch to word diff — it colors only the differing words. Conversely, for code, config files and lists (where a "change" is naturally a whole line), line diff is clearest. One more thing: a diff is exact, character for character, so two files that differ only in trailing spaces or line endings look noisy — normalize them first with the text cleaner and the real differences surface.

What do the four kinds of edit look like?

What this page actually returns for four kinds of edit. One word changed: the quick brown fox − jumps over the lazy dog + jumps over the lazy cat — the shared line is unmarked and the changed line appears twice. A line inserted: alpha + beta   gamma, a line deleted: alpha − beta   gamma — one marked line each, so an adjacent minus/plus pair means a change while a lone marker is a true insert or delete. Now the same three words moved from one line to three, with no change to the content:

−
one two three
+
one
+
two
+
three

Every line is marked. The line is the unit of comparison here, so reformatting destroys a diff — which is why "normalise line endings" belongs in its own commit, separate from any real change.

Frequently Asked Questions

Is my text uploaded?

No. The comparison runs entirely in your browser with JavaScript. Neither text is ever sent to a server, so it is safe for comparing confidential config files or code.

What is the difference between line and word diff?

Line diff compares whole lines — best for code, config files and lists. Word diff shows exactly which words changed — best for spotting small edits within a sentence. Switch anytime.

Does it ignore whitespace or case?

By default it compares exactly, so whitespace and case differences are highlighted. If you want to ignore them, normalize the format first with the text cleaner and then compare.

Can it compare very long text?

Yes, as long as it fits in browser memory. A few thousand lines is usually fine; very large inputs take a moment to diff.

Related reading

How to Compare Two Texts and See Exactly What Changed →

Embed this tool

Add this tool to your own website or blog for free — just copy and paste the code below (it includes a link back to this site).