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
- Paste the "original" and "changed" texts into the two boxes.
- The result appears instantly, with a summary of how many lines were added and removed.
- 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
+
threeEvery 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.