Startseite Text Diff Checker

Text Diff Checker

Compare two texts line by line and highlight added, removed and unchanged lines — 100% in your browser.

Input

Result

Paste two texts and click Compare.

What is a text diff?

A text diff is a comparison between two pieces of text that shows what was added, removed and left unchanged. The word "diff" comes from "difference", and the format has been a staple of programming since the 1970s. Instead of reading two documents side by side and hunting for changes by eye, a diff algorithm lines them up and marks every line that differs, so a reviewer can see the exact edits at a glance.

A typical diff presents each line with a prefix: a plus sign (+) for lines that exist only in the new version, a minus sign (-) for lines that exist only in the old version, and a space for lines that are identical. This compact notation lets a single page represent the full history of an edit, and it is the basis of every code review tool, patch file and merge request you will ever see.

Common diff algorithms

Several algorithms can produce a diff, and they differ mostly in how they find the longest sequence of lines that match between the two texts. The classic Hunt–McIlroy algorithm builds a longest common subsequence (LCS) and treats everything outside it as additions or deletions. It is what the original Unix diff command used, and it produces clean, minimal output that humans find easy to read.

Newer variants optimise for different goals. The Myers algorithm, used by Git, finds the shortest edit script and is very fast on typical source code. Histogram and patience algorithms try to keep "anchor" lines — such as function signatures — stable, which produces diffs that better reflect how a programmer actually thinks about a change. This tool uses an LCS-based approach that is easy to reason about and works well for prose, configuration files and source code alike.

When to use a diff checker

There are many everyday situations where a diff checker saves time and prevents mistakes. The most common ones include:

  • Reviewing edits. Paste the before and after versions of a contract, article or email to see exactly what changed, so no edit slips through unnoticed.
  • Comparing config files. Spot the difference between two versions of a settings file when debugging why one environment behaves differently from another.
  • Checking student work. Compare a submitted essay against an earlier draft to see how the argument evolved.
  • Merging notes. When two people edit the same document offline, a diff shows what each added so you can combine them deliberately.
  • Auditing data exports. Diff two CSV or JSON dumps to find which rows or keys changed between exports.

Whenever you need to understand the gap between two texts — not just whether they are equal, but where and how they differ — a diff checker is the right tool.

Diff in version control

Version control systems like Git, Mercurial and Subversion are built around diffs. Every commit is stored as a snapshot, but the system shows you the diff between snapshots so you can review what a change actually does. Pull requests and merge requests are, at their core, diffs that a human reads before approving. The same notation you see in this tool — added lines in green, removed lines in red — is what a code reviewer stares at all day.

Because diffs are so central to collaboration, learning to read them is a core skill for anyone who writes code or works with structured text. A good diff makes a change self-documenting: the added lines show what the author intended, the removed lines show what they replaced, and the surrounding unchanged lines give the context that makes the change understandable. This tool gives you that same clarity for any two texts, without needing a repository.

How to compare two texts

Comparing two texts with this tool takes a few seconds and runs entirely in your browser. Follow these three steps:

  1. Paste the original. Drop the first version of your text into the "Original text" box on the left.
  2. Paste the modified. Drop the second version into the "Modified text" box.
  3. Compare. Click "Compare" and read the result on the right: green lines were added, red lines were removed, and grey lines are unchanged. Click "Copy" to copy the diff as plain text.

Because the comparison runs as plain JavaScript on your own device, your text never leaves the browser. This makes the tool safe for confidential documents, contracts and source code that you cannot upload to a third-party service.

Is this diff checker free?

Yes, completely free, with no sign-up, no watermark and no limit beyond your device's memory.

Is my text uploaded to a server?

No. The comparison runs entirely in your browser as JavaScript, so your text never leaves your device. This makes the tool safe for confidential documents.

What algorithm does it use?

It uses a longest common subsequence (LCS) algorithm, the same family as the classic Unix diff. It finds the longest sequence of matching lines and marks everything else as added or removed.

Can it handle large texts?

It handles thousands of lines comfortably. Because the LCS algorithm uses memory proportional to the product of the two line counts, very large inputs may slow down, but everyday documents, source files and configs compare instantly.