Text Diff Checker

Paste two texts to compare them line by line.

🔍

Paste text in both boxes to see the difference

About Text Diff

The Text Diff tool compares two pieces of text line by line and highlights exactly what changed. Added lines are marked in green, removed lines in red, and unchanged lines are shown in plain text. The comparison runs entirely in your browser — neither version of your text is ever uploaded or stored.

How to compare text

Paste the original (or older) version of your text into the Original box on the left, and the revised (or newer) version into the Revised box on the right. The diff appears instantly below as you type. Click Clear both to reset and start a new comparison.

Common use cases

  • Document revisions — spot what changed between two drafts of a report, contract, or article.
  • Code review — quickly see what lines were added or removed in a snippet without using git.
  • Configuration files — compare two versions of a config or environment file to find discrepancies.
  • Proofreading — verify that an editor's suggested version only changed what you intended.
  • Data cleaning — find differences between two exported lists or CSV rows.

About the Text Diff Tool

A text diff tool compares two pieces of text side by side and highlights the differences between them — additions, deletions, and unchanged regions. It is one of the most useful tools in software development (where it powers code review on every major platform) but is equally valuable for writers comparing drafts, editors reviewing revisions, lawyers checking contract changes, and anyone trying to find what changed between two versions of a document.

The implementation is based on the classic line-based longest-common-subsequence algorithm originally described by Hunt and McIlroy in 1976. Every modern diff tool (git diff, diff -u, Beyond Compare, GitHub's PR view) descends from that algorithm, with various optimisations for speed and heuristics for nicer output.

Line diff versus word diff versus character diff

Most diff tools compare line-by-line because lines are a natural unit in source code and structured text. This works poorly for prose, where a small edit inside a paragraph appears as a full line replacement. Word-level and character-level diffs solve that problem by drilling into the line and highlighting only the changed substring. This tool focuses on line-level diff with intra-line highlighting — the format most familiar to anyone who has reviewed a pull request.

Why diffs matter beyond code review

A diff is a precise, defensible record of "what changed". Lawyers use diffs to confirm that contract amendments contain only the agreed-upon edits. Editors use them to track revisions through multiple drafts. Compliance teams use them to verify that policy documents were updated as promised. In every case the diff replaces an error-prone manual read-through with an exact comparison.

How to use the Text Diff Tool

  1. Paste the original text on the left

    The left panel holds the baseline — the older or canonical version.

  2. Paste the revised text on the right

    The right panel holds the newer or proposed version to compare against the baseline.

  3. Read the highlighted output

    Removed lines are highlighted in red, added lines in green, and unchanged lines appear normally. Scroll through to see every difference in context.

  4. Iterate

    You can edit either side and the diff recomputes instantly. Use this to test what a proposed change would look like before saving it.

Worked examples

Example 1

Input: Left: "The quick brown fox" / Right: "The slow brown fox"

Result: "quick" highlighted as removed, "slow" highlighted as added

Classic single-word substitution.

Example 2

Input: Two paragraphs identical except for an added closing sentence on the right

Result: Unchanged lines pass through; the new sentence is highlighted as an addition.

How additions look in a longer document review.

Real-world use cases

  • Reviewing your own writing between drafts to confirm what changed.
  • Comparing contract or policy revisions sent for sign-off.
  • Auditing copy changes between two website releases.
  • Quickly checking whether two configuration files are actually identical.
  • Validating output from automated text generation against an expected baseline.

Tips & common mistakes

  • Trim or normalise whitespace before comparing if you only care about meaningful changes — trailing spaces and mixed line endings produce noisy diffs.
  • For very large texts, paste them in smaller logical chunks so the diff is easier to read.
  • If the diff highlights too aggressively, consider whether the underlying text actually changed structure (e.g. paragraph reordering); a diff cannot guess intent.

Frequently asked questions

Is the text I paste sent to a server?

No. The comparison runs in your browser. Nothing is uploaded.

How big a document can it handle?

Several thousand lines work without noticeable lag. Very large documents (tens of thousands of lines) may be slow because diff is computationally O(N·M) in the simple case.

Does it ignore whitespace?

By default it does not — every whitespace difference counts. If you have a whitespace-insensitive use case, pre-process both inputs to collapse whitespace first.

Can it diff JSON or XML structurally?

No. It is a line-and-character diff, not a structural one. For JSON, format both files with the JSON Formatter first, then diff the formatted output — most differences will then appear as small intra-line changes.

Related tools

Last updated: June 2026 · All processing happens locally in your browser.