Text Diff Checker

Compare two texts and highlight the differences line by line, with unified and side-by-side views and ignore case or whitespace. All in your browser.

./diff-checker
Differences
+2−2
To-do list
- Buy bread
- Wash the car
+- Buy whole-grain bread
- Call Ann
+- Send email

Everything is processed in your browser; nothing is sent to any server.

Compartir

What this tool does

You paste two texts and it marks line by line what was added, what was removed and what stayed the same. It is a classic diff checker, the same kind of comparison git diff does, with two views, unified and side by side, and two switches to ignore case or whitespace when they do not matter.

Everything is processed in your browser. You can compare contracts, API responses, configuration files or a text before and after running it through an AI without anything leaving your machine.

How to use it

  1. Paste the original text on the left and the modified one on the right.
  2. Pick the view: unified (a single column, with + and ) or side by side (both columns aligned).
  3. If the differences you see are only case or spacing, switch on Ignore case or Ignore whitespace and they disappear.

The counter at the top summarises how many lines were added and how many removed. If it says “the texts are identical” with the options on, the only differences were the ones you chose to ignore.

Unified or side by side: which one to pick

The unified view is the one from git diff and from code review emails: compact, and the best when changes are few and scattered through a long text, because it only shows the lines that changed plus their context. The side by side view is the one from code editors: it shows both complete texts, aligned, and is the right one when you want to read the whole new version knowing where it differs from the old one, or when the change is a large reordering.

Rule of thumb: to review a change, unified; to understand two versions, side by side.

“Ignore whitespace” and “ignore case”: when they lie

The two switches exist because some real differences do not matter: an editor that re-indented the file, a Windows line ending against a Linux one, a “Client” that became “client”. But there are contexts where the difference you ignore is the bug:

  • In YAML and Python, indentation is syntax. A docker-compose file two spaces short is a different file. If you compare configuration, leave “ignore whitespace” off.
  • In passwords, API keys and Linux paths, case matters. Secret and secret are two different values.
  • In Markdown, two spaces at the end of a line are a line break. They vanish with the switch on.

Use them to remove noise, not as a default setting.

Why it compares lines rather than characters

The comparison finds the longest common subsequence between the two lists of lines: the largest set of lines that appear in the same order in both texts. Whatever is not in that set is marked as added or removed. It is the classic diff algorithm from 1976, and it is why a moved line shows up as a removal plus an insertion rather than a move: the algorithm knows nothing about moving, only about what matches in order.

Comparing by lines and not by characters is a deliberate choice. A character-level diff over a rewritten paragraph produces a soup of highlighted fragments nobody can read; by lines, you see that the paragraph changed and read both versions. If you need to spot a single changed word inside a long line, split the text into sentences (one per line) before pasting it.

For JSON, use the structural comparer

If what you are comparing is two JSON documents, this diff will flag key order, indentation and trailing commas as differences, and none of those are real changes. That is what the JSON diff is for: it walks both trees and reports only what actually changed, with the exact path (customer.email, products[2].price). The same goes for YAML: convert it first with the JSON and YAML converter and compare the structure.

When it is actually used

  • Contracts and legal texts: what changed between the version you signed and the one they are sending now.
  • Configuration: the production .env against staging; the nginx.conf that works against the one that does not.
  • AI-edited texts: exactly what the proofreader or the “improve this paragraph” touched.
  • API responses: yesterday’s output against today’s when “nothing changed”.
  • Translations: two deliveries of the same document.

With texts beyond 2,000 lines, the comparison is limited to the first 2,000 of each so the browser does not freeze; it tells you on screen if that happens.

Reviews & ratings

No reviews yet. Be the first to leave one!

Write a review

Your rating *