Skip to content
Tooletto

Diff Checker

Paste two blocks of text, code or config side by side and instantly see what was added, removed or left unchanged. Comparison runs entirely in your browser, so nothing you paste is ever uploaded.

  • Files never leave your device
  • Free, no signup
  • No watermarks
  • Works offline once loaded
Loading tool…

How to diff checker

  1. 1

    Paste both versions

    Paste the original text into the left box and the changed version into the right box.

  2. 2

    Pick a comparison mode

    Use "Lines" to compare line by line — the standard behaviour for code and config files — or switch to "Words" to see exactly which words changed within similar lines.

  3. 3

    Read the highlighted diff

    Added content is highlighted in green, removed content in red, and everything unchanged stays plain. Copy the result as a plain-text diff if you need to share it.

How a line diff decides what counts as "the same"

Underneath the highlighting, a diff tool is solving a specific matching problem: given two lists of lines, find the longest sequence of lines that appears, in the same relative order, in both documents — everything in that shared sequence is left unchanged, and everything else is what gets marked as added or removed. This is the intuition behind the "longest common subsequence" idea that every general-purpose diff algorithm is built around, including the one Git itself uses. It explains a detail that otherwise looks odd: moving a block of text from the bottom of a document to the top is usually reported as a large removal plus a large addition, rather than as a single "moved" operation — the algorithm is only looking for a shared order, and a relocated block breaks that order at both its old and new position.

It also explains why a single-character edit to a long line marks the *whole line* as changed in line mode: the algorithm compares whole lines as indivisible units, so "the same line except for one letter" and "a completely different line" are treated identically — both fail the equality check and both count as one line removed, one line added. That is exactly the situation where switching to word mode helps, since it re-runs the same underlying idea one level down, treating each word as the unit being matched instead of each line.

When word-level diffing is more useful than line-level

Line mode is the right default for anything where a line is a meaningful unit on its own — source code, JSON objects, CSV rows, log entries — because in those formats a single line usually represents one complete idea, and knowing that a particular line changed is itself useful information, independent of which character within it moved. Word mode becomes more useful the moment the meaningful unit is smaller than a line: a paragraph of prose, a contract clause, or a sentence in a long document, where the interesting change is usually a single word or phrase and the surrounding sentence is identical. Comparing such text line-by-line would mark the entire paragraph as "changed" for a one-word edit, which is technically correct but tells you nothing about what actually changed until you read the whole paragraph again yourself.

A practical rule: reach for line mode first for anything structured or line-oriented, and switch to word mode specifically when a line-mode result shows two large blocks of red and green that look almost identical — that pattern is the signal that the real difference is small and buried inside otherwise-unchanged text.

Common practical uses beyond comparing prose

Comparing two revisions of source code before merging them is the textbook use case, but the same technique applies well beyond a code review: comparing two exports of a configuration file to spot exactly which setting changed between a working deployment and a broken one, checking two versions of a CSV export to confirm only the rows you expected were touched, or comparing a contract draft against a previous revision to find every clause a counterparty modified without reading the entire document side by side again. In every one of these cases the value of a diff tool is the same — it turns "are these two things different, and if so, where" from a manual side-by-side reading exercise into an immediate visual answer.

Frequently asked questions

Is either text uploaded to a server?

No. Both texts are compared entirely inside your browser using JavaScript — nothing is sent over the network at any point. You can disconnect from the internet after the page loads and the comparison still works, which you can verify yourself.

What exactly counts as a "difference"?

In "Lines" mode, two lines are compared as whole units — if a single character on a line changes, the entire line is marked as removed from the original and added in the changed version. In "Words" mode, the same line is instead compared word by word, so only the specific word that changed is highlighted while the rest of the line stays plain. Leading and trailing whitespace, blank lines and line breaks are all treated as real content in both modes — a line that differs only by trailing spaces is still reported as changed.

Does this work for code, JSON or config files, not just prose?

Yes — line-based diffing is exactly the technique used by version control tools like Git, and it works the same way here for source code, JSON, YAML, CSV rows, log files or any other line-oriented format. Word mode is more useful for prose, contracts or documentation, where the meaningful change is usually a phrase within a sentence rather than the whole line.

Can it handle large documents?

Yes. Comparisons up to a few thousand lines complete effectively instantly. The diff recalculates on every keystroke at a lower rendering priority, so typing stays smooth even while a large paste is being compared — for very large or very different documents, the comparison itself may take a brief moment longer, but it will never freeze the page.

Which lines does the "+N added, −M removed" count refer to?

It counts the total number of added and removed lines (or words, in Word mode) across the whole comparison — the same numbers you would get by counting every green and red line in the result. Unchanged lines are not counted.

Can I get the diff as plain text instead of the colored view?

Yes. The "Copy diff" button copies a plain-text version with a leading "+", "-" or blank marker on every line (the same convention used by Git and most command-line diff tools), so you can paste it into an email, a ticket or a code review comment.