Skip to content
Processing locally — files never leave your device

Text Diff Checker

Paste two versions of text side by side and instantly highlight every addition, deletion, and change, line by line. Useful for comparing config files, contract revisions, code snippets, or any two drafts. The comparison runs entirely in your browser, so even confidential text never leaves your device.

+0 0

How to use Diff Checker

  1. Paste the original text on the left.
  2. Paste the changed text on the right.
  3. Read the diff below — green lines were added, red lines were removed, unchanged lines stay neutral.
  4. Switch to "Words" mode for prose comparisons or "Chars" for fine-grained, character-level edits.
  5. Copy the result or screenshot it to attach to a code review or bug report.

Comparing text the way Git does

A diff checker answers one question fast: what changed between two versions of some text? Whether you are reviewing a pull request snippet, comparing two API responses, or proofreading an edited paragraph, seeing the additions and removals highlighted is far quicker than reading both versions top to bottom.

Line diff vs word diff vs char diff

The granularity you choose changes what counts as a change. A line diff compares whole lines and is ideal for code, configs, and logs, where a line is a meaningful unit. A word diffcompares token by token and shines on prose, where reflowing a paragraph would otherwise mark every line as changed. A char diff goes finest, pinpointing a single altered character — perfect for spotting a typo or a flipped digit.

How the algorithm decides

Under the hood, text diffing finds the longest common subsequence: the longest ordered run of lines or words that appears in both inputs. Everything outside that shared run is classified as added or removed. This is the same foundation used by the Unix diff utility and by Git when it renders a commit.

- const timeout = 3000;
+ const timeout = 5000;
  retry(request, timeout);

Here a single line changed: the old value is shown with a minus, the new value with a plus, and the surrounding context line stays neutral.

A worked example: the same edit in three modes

Suppose you tweak one sentence in a README. The original is The cache expires after 30 seconds by default. and the edit is The cache expires after 60 seconds unless overridden. What you see depends entirely on the mode you pick:

Lines:  - The cache expires after 30 seconds by default.
        + The cache expires after 60 seconds unless overridden.

Words:  The cache expires after [30→60] seconds [by default→unless overridden].

Chars:  ...after 3[0→]0... (only the changed digit and tail differ)

In line mode the whole sentence is flagged as one removal plus one addition, even though only two phrases moved — accurate, but you have to re-read the line to find the real change. In word mode the diff isolates exactly the two edits (30 became 60, by default became unless overridden) and leaves the rest untouched, which is why word mode is the right call for prose. Char mode is overkill here; it shines when the change is a single transposed letter or a flipped digit buried in an otherwise identical string, where word mode would still highlight the entire token.

Using diffs in code review

In review, a focused diff removes noise. Instead of re-reading an entire file, you paste only the function before and after a change and immediately see whether the refactor altered behaviour. It is equally useful for verifying that two environment configs match, confirming a generated file did not drift, or checking that a copy edit only touched the intended sentence.

Whitespace and significance

By default every character matters, including trailing spaces and indentation, because in Python, YAML, and Makefiles whitespace is part of the meaning. If indentation churn is hiding the real change, normalize both sides first so the diff highlights only what you care about.

Limitations to know

Diffs preserve order, so a block of code moved elsewhere shows up as one removal and one addition rather than a relocation. That is expected behaviour for line, word, and char modes alike — the paired red and green usually make the move obvious enough during review.

Related dev tools

Frequently asked questions

Can I compare confidential code or a contract draft here?
Yes — the comparison is computed in the tab, so both versions you paste stay on this page and vanish when you close it. Nothing is uploaded, which makes it fine for proprietary source or a document under NDA.
Which mode should I use — lines, words, or chars?
Use "Lines" for source code, config files, and any structured text. Use "Words" for prose, articles, and copy where line breaks do not matter. Use "Chars" when you need to see exactly which character changed, such as a typo or a single-digit edit.
How does a diff actually get computed?
Most diff tools find the longest common subsequence (LCS) between the two inputs — the longest ordered set of lines or tokens that appear in both. Anything not in that common sequence is reported as an addition or a removal. This is the same core idea behind the Unix diff command and Git.
What is a unified diff?
A unified diff shows removals and additions together in one column, with removed lines prefixed by a minus and added lines by a plus. It is the format Git and patch files use. A side-by-side diff instead shows the two versions in parallel columns, which some people find easier to scan.
Will it detect a moved block of code?
A line-based diff treats a moved block as one removal and one addition, because LCS preserves order. It will not say "this moved from line 10 to line 80." Word and char modes have the same limitation. For move detection you need specialized tools, but for review purposes the added/removed pair is usually clear enough.
How does this help in code review?
Pasting the before and after of a function shows precisely what changed without the noise of an entire file. It is handy for reviewing a snippet someone shared in chat, comparing two API responses, checking that a refactor preserved behaviour, or confirming a config change before deploying.
Does it ignore whitespace?
By default whitespace counts as content, so trailing spaces and indentation changes show up. That is intentional — in languages like Python or YAML, whitespace is significant. If you only care about meaningful changes, normalize indentation in both inputs first.
How big can the inputs be?
Line mode handles tens of thousands of lines instantly. Word and char modes do more work per token, so a hundred-thousand-line input may take a few seconds in those modes. For very large files, prefer line mode.

More tools you might find useful in the same flow.

Built by Muhammad Tahir · About