webby.tools

Text Diff Tool

Paste two blocks of text to instantly see what changed between them. Added lines are highlighted green, removed lines red, and unchanged lines are shown normally. Useful for comparing document revisions, code snippets, essays, contracts, and more.

How the Text Diff Works

This tool uses the Longest Common Subsequence (LCS) algorithm to find what the two texts share in common, then marks everything else as an addition or deletion. LCS is the same algorithm used by professional diff tools like Unix diff and Git's built-in diff engine.

The three comparison modes control the granularity of the diff:

  • Line diff: Each line is treated as one unit. A line is either unchanged, added, or removed. This is the most common view for comparing documents and code.
  • Word diff: Individual words are compared. Useful when you want to see which specific words changed within a line of text.
  • Character diff: Every character is compared individually. Best for short strings or precise spell-checking comparisons.

Common Use Cases

  • Document revisions: Compare a contract, policy document, or essay draft before and after edits to confirm only intended changes were made.
  • Code review: Quickly spot changes between two versions of a script, configuration file, or template without setting up version control.
  • Content compliance: Verify that published content matches an approved version exactly.
  • Plagiarism detection assistance: Compare a student submission against a known original to find verbatim passages.
  • Translation comparison: Align source and target language text to confirm no passages were accidentally omitted.

Frequently Asked Questions

Is there a text size limit?

There is no hard limit — the comparison runs entirely in your browser. However, very large texts (tens of thousands of lines) may take a few seconds to process since LCS is O(n×m) in the worst case. For extremely large files, a dedicated CLI tool like diff or a version control system would be faster.

Does this tool store my text?

No. Everything runs locally in your browser. The text you paste is never sent to any server. This makes the tool safe to use with confidential content such as legal documents or proprietary code.

What does "ignore case" do?

When checked, "Hello" and "hello" are treated as identical. This is helpful when comparing text that may have been reformatted with different capitalisation but the same content.

How is this different from Find and Replace?

Find and Replace (like the find and replace tool) lets you search for a specific string and substitute it. A diff tool shows you all differences between two complete texts without knowing what to look for in advance — it discovers the changes for you.

This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.